Skip to content

BorkedFork/cst116-intro-programming-animal-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Animal Shelter Sorting System

A C++ console application for managing and sorting animal shelter records with multiple sorting options.

Description

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++.

Features

  • 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

Data Structure

Each animal record contains:

  • Name (up to 20 characters)
  • Type (up to 10 characters) - e.g., Dog, Cat, Bird
  • Age (integer)

Technologies Used

  • C++
  • Structs for data organization
  • File streams (<fstream>)
  • String manipulation (<cstring>)
  • Formatted I/O (<iomanip>)
  • Sorting algorithms
  • Visual Studio project structure

Building and Running

Prerequisites

  • C++ compiler (Visual Studio recommended)
  • Windows operating system
  • Animal data file

Build Instructions

  1. Open the solution file in Visual Studio
  2. Build the solution (F7 or Build > Build Solution)
  3. Run the executable or press F5

Usage

  1. Prepare a data file with animal records
  2. Run the program
  3. Select sorting option from the menu:
    • Sort by name
    • Sort by type
    • Sort by age
  4. View the sorted animal list

Example Output

Name              Type      Age
==============================

Buddy             Dog       3
Whiskers          Cat       2
Charlie           Dog       5
Tweety            Bird      1
Max               Dog       7

File Format

The input file should contain one animal per line:

Name Type Age

Author

Christian Burnett

About

C++ animal shelter management system with multiple sorting options

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages