A C++ console application for managing and sorting animal shelter records with multiple sorting options.
This animal shelter management system reads animal data from files and provides multiple sorting capabilities. Users can sort animals by name, type, or age, making it easy to organize and find animals in the shelter database. The program demonstrates struct usage, file I/O, sorting algorithms, and menu-driven interfaces in C++.
- File-based Data Management: Reads animal records from external files
- Multiple Sort Options:
- Sort by animal name (alphabetically)
- Sort by animal type
- Sort by age
- Struct-based Records: Uses custom data structures for animal information
- Menu-driven Interface: User-friendly selection system
- Formatted Display: Professional table formatting with headers
- Data Persistence: Loads and displays up to 25 animal records
Each animal record contains:
- Name (up to 20 characters)
- Type (up to 10 characters) - e.g., Dog, Cat, Bird
- Age (integer)
- C++
- Structs for data organization
- File streams (
<fstream>) - String manipulation (
<cstring>) - Formatted I/O (
<iomanip>) - Sorting algorithms
- Visual Studio project structure
- C++ compiler (Visual Studio recommended)
- Windows operating system
- Animal data file
- Open the solution file in Visual Studio
- Build the solution (F7 or Build > Build Solution)
- Run the executable or press F5
- Prepare a data file with animal records
- Run the program
- Select sorting option from the menu:
- Sort by name
- Sort by type
- Sort by age
- View the sorted animal list
Name Type Age
==============================
Buddy Dog 3
Whiskers Cat 2
Charlie Dog 5
Tweety Bird 1
Max Dog 7
The input file should contain one animal per line:
Name Type Age
Christian Burnett