Pure Programmer
Blue Matrix


Cluster Map

Project: Dog Years (Command Line)

It is said that dogs age in one year the equivalent of seven years of human grown. A puppy of one year is the same as a human of seven years. A dog of two years of age is equivalent to a human teenager of 14. Write a program that uses integer constants and variables to compute the equivalent ages of a dog in human years. Pass the number of dog years in on the command line.

See: DogYears

Output
$ rustc DogYearsCmdLine.rs error[E0425]: cannot find value `Utils` in this scope --> DogYearsCmdLine.rs:10:27 | 10 | let mut dogYears:isize = Utils.stoiWithDefault(args[1], 0); | ^^^^^ not found in this scope error[E0425]: cannot find value `args` in this scope --> DogYearsCmdLine.rs:10:49 | 10 | let mut dogYears:isize = Utils.stoiWithDefault(args[1], 0); | ^^^^ not found in this scope | help: consider importing this function | 7 + use std::env::args; | error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0425`.

Solution