Answered step by step
Verified Expert Solution
Question
1 Approved Answer
As a group, you're going to make software to manage appointments at the DMV. Your program will read in several appointments from a data file
As a group, you're going to make software to manage appointments at the DMV. Your program will read in several appointments from a data file and store them into a queue data structure. Then you'll determine who is next based on the order of their appointment times.
Flow of the program:
1. Read in all the appointments from the data file, create an "Appointment" object for each one, and add each one to an "AppointmentQueue". The data file to read from is here:
Jameson,ID,600
Johnson,ID,700
Stevenson,Registration,730
Anderson,DL,630
Jones,ID,645
Franklin,Registration,745
Roosevelt,DL,615
Nicholson,Registration,800
Blackwell,DL,715
Reynolds,DL,815
2. Prompt the user to enter their name and then determine whether or not they are next in the queue
3. If they are next, output to the screen that the DMV will help them now and remove them from the queue. If they are not next, give them a harsh rejection message like the DMV usually does.
4. Keep prompting for the next person until everyone has been helped.
Requirements:
1. You shall create three classes: a main class called "Assignment6", an "Appointment" class, and an "AppointmentQueue" class
2. The Appointment class will hold the information for a single appointment (name, reason, time).
3. The AppointmentQueue class will hold all of the appointment objects. This queue class should at least have "push" and "pop" methods for adding and removing from the queue (more may be needed). The earliest remaining appointment should come off the queue when "pop" is called.
The Hard Part:
Your "AppointmentQueue" class must use a basic array of initial size 5 to hold the appointments. When the "push" method is called, your class must be able to automatically expand the array when needed to fit additional appointment objects.
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