Question
You have just started your new on-campus job at the front desk of the Swinney recreation center. Your job is to help students check-out and
You have just started your new on-campus job at the front desk of the Swinney recreation center. Your job is to help students check-out and check-in gym items (towels, basket balls, rackets, bikes, etc). Traditionally, students who work this job record all items that students check out and in manually in two text files (checked out and checked in). At the end of the day, they update a third file (students.txt) that includes information about students and what items are currently checked out (if any). However, you believe that this process is tedious, time consuming and error prone. Therefore, you are thinking to automate this process by writing a C++ program that does all the work for you; because you are a great programmer who took 201L, and you can do it! See the following figure to better understand your program input and output.
Your application will have a Student class with the following private data members:
string for first and last name
unsigned int for the ID number
unsigned int for the number of items checked out and the array size
string pointer (string*) to manage the dynamic array
The main() function: You have three input files:
The first file, students.txt, is the roster of all students who come to the gym, including what items they have checked out (if any). Your program should use a dynamic array of Students class to store this data.
The second file, ItemsCheckedOUT.txt, lists what several users have checked out. It is in the form of a series of (StudentID, ItemID) ordered pairs, with items separated by whitespace. Your program will process this file to check out the indicated items correspondingly.
The third file, ItemsCheckedIN.txt, has several items that are being checked in. Search the data array until you find the student who has that item checked out first, and check it in using the class method. Your application output: Your application should produce a new text file, Updated_Students.txt, which is an updated file with all checkouts and check-ins processed, in the same format as the students.txt file. Remember:
Make sure you clearly understand the program and its requirements
Always utilize the instructors office hours
Write a neat easy-to-follow code and organize it
checkouts.txt
82600 Towel 82600 Volleyball 82600 Badminton 82600 Racquetball 82600 Scoreboard 82600 Tent 47322 Cooler 15359 Towel 60772 Towel 60772 Locker 58517 Locker 58517 Dodgeball 80426 iPhoneCuzWhyNot
checkins.txt
Locker Towel Towel Towel Towel Towel Goggles Goggles Cooler Volleyball Locker
students.txt
82600 LESLIE PEZ 0 60772 TAMI OWENS 0 51062 MLINDA GOON 0 58517 JIMMY BLAKE 0 19232 JESSIE SIMON 2 Locker Towel 80426 COTNY PETSN 0 33354 CLARK ROSS 7 Badminton Towel Basketball Cooler Dodgeball Frisbee Goggles 98428 TERRI MACK 0 24074 BENJAMIN POPE 0 60855 MARLON BLACK 0 53124 BRAD ESTRADA 0 47322 ROSE TUCKER 6 Locker Towel Frisbee Kickball Racquetball Scoreboard 51162 CLYDE PITTMAN 9 Towel Locker Scoreboard Cooler Goggles Badminton Racquetball Tent Volleyball 55094 WILFRED WHEELER 0 95017 SUE LEONARD 5 Volleyball Towel Locker Cooler Goggles 15359 MARVIN PHILLIPS 0
Expected output:
82600 LESLIE PEZ 3 Scoreboard Racquetball Badminton 60772 TAMI OWENS 0 51062 MLINDA GOON 0 58517 JIMMY BLAKE 1 Dodgeball 19232 JESSIE SIMON 1 Locker 80426 COTNY PETSN 1 iPhoneCuzWhyNot 33354 CLARK ROSS 3 Badminton Dodgeball Basketball 98428 TERRI MACK 0 24074 BENJAMIN POPE 0 60855 MARLON BLACK 0 53124 BRAD ESTRADA 0 47322 ROSE TUCKER 4 Locker Racquetball Frisbee Kickball 51162 CLYDE PITTMAN 4 Towel Locker Scoreboard Cooler 55094 WILFRED WHEELER 0 95017 SUE LEONARD 4 Volleyball Towel Locker Cooler 15359 MARVIN PHILLIPS 1 Towel
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started