Pure Programmer
Blue Matrix


Cluster Map

Project: Retirement Calculator

Write a program that determines if someone is eligible for retirement. It should accept two command line arguments. The first is the person's age. The second is the number of years of service with the company. A person is eligible for retirement if they are 67 or older or if they are 55 years or older with 25 or more years of service with the company.

Output
$ rustc RetirementCalculator.rs error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:15:5 | 15 | if args.len() < 2 { | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error[E0425]: cannot find function `exit` in this scope --> RetirementCalculator.rs:17:3 | 17 | exit(1); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::process::exit; | error[E0425]: cannot find value `Utils` in this scope --> RetirementCalculator.rs:20:22 | 20 | let mut age:isize = Utils.stoiWithDefault(args[1], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:20:44 | 20 | let mut age:isize = Utils.stoiWithDefault(args[1], 0); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error[E0425]: cannot find value `Utils` in this scope --> RetirementCalculator.rs:21:26 | 21 | let mut service:isize = Utils.stoiWithDefault(args[2], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:21:48 | 21 | let mut service:isize = Utils.stoiWithDefault(args[2], 0); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0425`. $ rustc RetirementCalculator.rs error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:15:5 | 15 | if args.len() < 2 { | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error[E0425]: cannot find function `exit` in this scope --> RetirementCalculator.rs:17:3 | 17 | exit(1); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::process::exit; | error[E0425]: cannot find value `Utils` in this scope --> RetirementCalculator.rs:20:22 | 20 | let mut age:isize = Utils.stoiWithDefault(args[1], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:20:44 | 20 | let mut age:isize = Utils.stoiWithDefault(args[1], 0); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error[E0425]: cannot find value `Utils` in this scope --> RetirementCalculator.rs:21:26 | 21 | let mut service:isize = Utils.stoiWithDefault(args[2], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:21:48 | 21 | let mut service:isize = Utils.stoiWithDefault(args[2], 0); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0425`. $ rustc RetirementCalculator.rs error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:15:5 | 15 | if args.len() < 2 { | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error[E0425]: cannot find function `exit` in this scope --> RetirementCalculator.rs:17:3 | 17 | exit(1); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::process::exit; | error[E0425]: cannot find value `Utils` in this scope --> RetirementCalculator.rs:20:22 | 20 | let mut age:isize = Utils.stoiWithDefault(args[1], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:20:44 | 20 | let mut age:isize = Utils.stoiWithDefault(args[1], 0); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error[E0425]: cannot find value `Utils` in this scope --> RetirementCalculator.rs:21:26 | 21 | let mut service:isize = Utils.stoiWithDefault(args[2], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:21:48 | 21 | let mut service:isize = Utils.stoiWithDefault(args[2], 0); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0425`. $ rustc RetirementCalculator.rs error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:15:5 | 15 | if args.len() < 2 { | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error[E0425]: cannot find function `exit` in this scope --> RetirementCalculator.rs:17:3 | 17 | exit(1); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::process::exit; | error[E0425]: cannot find value `Utils` in this scope --> RetirementCalculator.rs:20:22 | 20 | let mut age:isize = Utils.stoiWithDefault(args[1], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:20:44 | 20 | let mut age:isize = Utils.stoiWithDefault(args[1], 0); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error[E0425]: cannot find value `Utils` in this scope --> RetirementCalculator.rs:21:26 | 21 | let mut service:isize = Utils.stoiWithDefault(args[2], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> RetirementCalculator.rs:21:48 | 21 | let mut service:isize = Utils.stoiWithDefault(args[2], 0); | ^^^^ not found in this scope | help: consider importing this function | 12 + use std::env::args; | error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0425`.

Solution