This Rust program reads data from a text file containing Human Development Index (HDI) values for various countries and classifies them into different categories based on their HDI scores. It then randomly selects a sample of countries from each category and prints them out.
Before running this program, ensure you have the following installed on your system:
- Rust: The Rust programming language and its tools.
- Git: Version control system for managing the source code.
To get started with this program, follow these steps:
-
Clone the Repository: Open your terminal and clone this repository using the following command:
git clone https://github.com/your_username/hdi_country_classifier.git
-
Navigate to the Project Directory: Change your current directory to the cloned repository:
cd hdi_country_classifier
-
Build and Run the Program: Build and run the program using Cargo, the Rust package manager:
cargo run
This command will compile the code and execute the program.
After running the program, you will see the sample countries printed for each HDI category:
- Very high human development
- High human development
- Medium human development
- Low human development
The program expects a text file named HDR21-22_Statistical_Annex_HDI_Table.txt
located in the data
directory. This file should contain country names and their corresponding HDI scores separated by spaces. This file comes included with the repository.
The program outputs a sample of countries from each HDI category, randomly selected from the input data.
This project is licensed under the MIT License - see the LICENSE file for details.
This program utilizes the rand crate for random number generation.