EECS2500 Ethan’s Car Wash Project 6 solution


Original Work


5/5 - (6 votes)

This project may be done in pairs, but the pairs cannot be the same as on the final project. If
the same pair does the final project together, there will be an automatic 50 point deduction on
the final project.
Individual submissions that are very similar to another individual submission will be given an
automatic 50 point deduction. In particular, if more than 10 lines of code are identical or very
similar to the code of another student who is not one’s partner, 50 points will be automatically
deducted from both students.
Grading for this project only:
Fully working program – 80 points
Good but limited use of comments – 10 points
Good Spacing within a line – 10 points
Use of vertical alignment – 20 points
Good variable names – 10 points
Good method names – 10 points
Ethan’s Car Wash has decided to do a study of their business, which they believe has not been
as good as they would have liked. Based on some data they have obtained, they assume the
 Customers arrive at the car wash in random integer intervals of 1 to 5 minutes. That is, when a
customer arrives, the next customer will arrive in the next 1 to 5 minutes.
 Customers are served in random integer intervals of 2 to 5 minutes. That is, when a car is
actually washed, it will take anywhere from 2 to 5 minutes to finish depending on the level of
wash that was selected.
 The car wash can only hold up to 8 cars waiting to be serviced. If a customer arrives and there
are 8 cars waiting, the customer will have to bypass the car wash.
Ethan wants a program to implement a car wash simulation as follows:
1. Initialization:
a. Read in the number of hours and number of minutes for the car wash shift.
b. Read in the number of customers waiting in line when the car wash opens.
2. For each minute of the shift:
a. If the time matches the next customer’s arrival time
Record the fact that a customer has arrived
if there are less than 8 cars waiting, enqueue the customer and record the arrival time.
Schedule the arrival time for the next customer (in the next 1 to 5 minutes)
b. If the time is the next customer’s finish time (i.e. the car wash becomes free)
Record the fact that a customer has completed service
Dequeue the next waiting customer
Calculate this customer’s wait time
Determine this customer’s service time (2 to 5 minutes) and
Calculate this customer’s completion time (thus when a new customer can begin service).
3. At the completion of the shift, report the following information:
a. Total number of customers served
b. Number of minutes the car wash was idle
c. Average wait time
d. Longest wait time
e. The number of customers that bypassed the car wash
Ethan wants the program to simulate service for a shift of 8 hours (480 minutes), and of course,
see the output. The service line must be implemented as a queue that will contain the
customer’s arrival time (in minutes from the start of the 8 hour period). You must define your
own class to implement a queue. // This IS required.
Ethan requires that the program be implemented with a GUI. A very simple GUI will suffice. A
GUI is NOT required. The GUI is for the Honors project.
For the input, use three field’s, one for input of the hours, one for input of the minutes, and one
for the input of the number of cars waiting when the car wash opened. For the output, you may
append all output to a simple window.
For testing the program, use a much smaller time period (say 20 minutes), and consider printing
a message when a customer arrives, step 2a, and when a customer’s car has started being
serviced, step 2b.
For the project submision, show the results from a simulation of 8 hours. See the posted file
Submission of Projects.pdf