Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help with this code Problem: Write a C++ program that will allow a research lab manager to monitor the access to a research lab.
Need help with this code
Problem: Write a C++ program that will allow a research lab manager to monitor the access to a research lab. Each member of the lab has access provided by their personal ID Card Your program will provide information about the timing of the arrivals and departures of the lab staff. Your program will be provided with a dataset where each row records an event, which is represented by the following information 1) ID number - a positive integer number 2) Person's name a string 3) Time of the event - a string in "01:23AM" format ("dd:dd:AM" or "dd:dd:PM") Each event records the use of an ID card to either enter or exit the lab. A given data set corresponds to one day and is already sorted by ID number. You should assume that the lab is empty at the beginning of the day and events are consistent a given person cannot enter or exit without the event being recorded, a given person cannot enter the lab twice without exiting once in between, etc. The program should first read the events from a text file named "dataset.txt" It wil contain up to 100 events. See the sample file on the class website Then, it should offer the user a menu with the following options: 1. Display the events sorted by ID number 2. Display the events sorted by the time of event. 3. Print the person's name given his/her ID number. 4. Find out whether some person is still in the lab given his/her ID number 5. Quit The program should perform the selected operation and then re-display the menu Do not change the menu numbers associated with the operations. Display an error message if the user enters an inappropriate number For options 1 and 2, display the information for each event on a single, separate line The values should line up in columns (use setw). Headers for the table are optional 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