The car washing team at Acme Car Wash takes 4 minutes to wash a car and six minutes to wash a suv. On average a vehicle arrives at Acme every four minutes (25% chance of arrival at any given minute) This vehicle has a 30% chance of being a suv. The cost of washing a car is $3.00. The cost of washing a suv is $5.00. The charge for a car wash is $17.00. The charge for a suv wash is $22. Write a program to simulate a 10 hour day.
Write a vehicle queue class, a application driver class, and a cashier class .
using queue... e-mail me and if get the program right, u will be paid in reasonable price... kingka91@yahoo.com
The pseudo code for the simulation is:
initialize statistical counters Create the queue for time-stamped vehicle For each minute in the days operation 3.1 Call random number generator to determine if a new vehicle has arrived
3.2 If a new vehicle has arrived THEN
3.2.1 Determine if it is a car or suv
3.2.2 Time stamp and enqueue it into the queue of vehicles
3.3 IF no car is currently being washed AND the queue of waiting vehicles is not
empty then
3.3.1 Dequeue a vehicle from the queue for washing
3.3.2 Use the time stamp for the vehicle just dequeued to determine how long it
waited.
3.3.3 Add that wait time to the accumulating total wait time
3.3.4 Record that washing a vehicle has just begun
3.4 If a vehicle is being washed then
3.4.1 Reduce by one minute the time left before the vehicle is completely washed
For the random number generated: if rnd<= .25 a vehicel has entered the queue. If rnd >.25 a car has not entered the queue.
If the random number generated for vehicle determination is <=.30 then the vehicle is a suv . If >.30 the vehicle is a car.
Output:
Vehicle Vehicle Entry Wait Number Type Time Time -------- ----- ----- -----
Average wait time: --------- Total Vehicles Washed: ------- Revenue: ------- Profit: --------
Total SUVS washed: ------------- % of Total -------- Total Cars washed: ------------ % of Total ---------
Have you written any code or are you expecting us to do your homework for you? I don't mind helping you find errors in your code or your logic, but I'm not doing anyones homework for them.