subject
Engineering, 13.09.2019 00:20 ajbrock1004

Introduction
zettaair airlines had only one plane with only 3 seats for passengers. the company needed a computer program to book passengers, or if the plane was fully booked, to add customers to a waiting list (also 3 long).
program description
your program will display (see the sample output) the following menu at startup and will continue to do so, after it executes the user's choice to add, delete or show passengers, until the user chooses exit, which of course exits the program.
menu

1. add passenger
2. delete passenger
3. show passengers
4. exit
enter choice:
the program maintains two lists, which as explained below are both queues. the first is for booked passengers. since the plane has only 3 seats for passengers, only 3 passengers can be on this list. the second is the waiting list. zettaair's policy is not to have more than 3 customers on the waiting list; anyone else is told to try again later.
adding
you add a customer to the list of booked passengers unless that list is full (3 booked passengers). if it is, then you add the customer to the waiting list unless that list also is full (maximum size of waiting list is 3). if so, you tell the customer sorry, try again later. each passenger is added in order.
deleting
if there are any booked passengers, then you delete the first passenger on that list. next, if there are any customers on the waiting list, you add the first customer on the waiting list to the list of booked passengers, and of course take that customer off the waiting list.
if there are no booked passengers, then there is no one to delete (if there are no booked passengers there can't be any customers on the waiting list).
showing a passenger
see the sample output. if there are any booked passengers, then you list them in order. you then list in order any customers on the waiting list unless there are none, in which case you advise there is no one on the waiting list.
if there are no booked passengers, then there is no one to show (if there are no booked passengers there can't be any customers on the waiting list), so you advise there are no booked passengers.
queue class
both the booked passenger list and the waiting list are queues. since deletions are permitted, each queue will be implemented by a circular or ring queue. this concept is explained in the book and in module #4 (queue).
you will write the queue as a class. module #4 (queue) explains the member variables and member functions, including a constructor.
files
the class will be written using header and implementation files. your program also will include a driver file, so your multi-file project will have these three files and no others:
file name purpose
cqueue. h header file for queue
cqueue. cpp implementation file for queue
test. cpp driver file
your job
the code/output handout provides all the code for the cqueue. h file (except the value of one constant) and the test. cpp file except the implementation of the add, delete and show functions. your job is to complete those two files and write the cqueue. cpp file.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
question
Engineering, 04.07.2019 18:10
The drive force for diffusion is 7 fick's first law can be used to solve the non-steady state diffusion. a)-true b)-false
Answers: 1
question
Engineering, 04.07.2019 18:10
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
question
Engineering, 04.07.2019 18:20
Avolume of 2.65 m3 of air in a rigid, insulated container fitted with a paddle wheel is initially at 264 k, 5.6 bar. the air receives 432 kj by work from the paddle wheel. assuming the ideal gas model with cv = 0.71 kj/kg • k, determine for the air the amount of entropy produced, in kj/k
Answers: 2
You know the right answer?
Introduction
zettaair airlines had only one plane with only 3 seats for passengers. the compa...
Questions
question
Mathematics, 25.04.2020 01:07
question
Mathematics, 25.04.2020 01:07
Questions on the website: 13722367