This Rust application generates a random person with a name and age, then prints out the person's details and a greeting. To start working with Rust, visit rust-lang.org
- Random Name Generation: Generates a random name with a length between 6 and 10 characters.
- Random Age Generation: Generates a random age between 1 and 100.
- Random Person Generation: Generates a random person with a random name and random age.
- Person Struct: Contains the name and age fields, with methods for creation and greeting.
- Display Trait: Implements the
Display
trait for thePerson
struct for easy printing.
To run the application, follow these steps:
-
Clone the Repository:
git clone <repository-url> cd <repository-directory>
-
Build the Project:
cargo build
-
Run the Project:
cargo run
Name: hurtylhdx, Age:59
Hello, my name is hurtylhdx and I am 59 years old.