Having difficulty with understanding how to code the rest of this program. Simulation Problem:
You own a car wash business and want to analyze customer service information. The car wash opens at 8:00am. Customers drive up to a ticket dispenser where they choose option 1 for a wash only or option 2 for a wash and wax. The customer receives a car wash ticket which has the time in hours and minutes and the option number (1 or 2). The customer drives through the car wash once it is open and not busy. The time for option 1 is 10 minutes; the time for option 2 is 14 minutes.
suggested pseudocode:
Build the customer queue
Print heading
While (customer queue is not empty)
Get a customer item from the queue
Determine the wash time
Determine the start time for this customer car
Determine the finish time for this customer car
Determine the wait time for this customer car
Print the information for this customer
Calculate and print the average wait time
Here's what i have so far
Code:
#include<iostream>
#include "linkedQueue.h"
#include<fstream>
using namespace std;
struct TicketInfo
{
int stampHour;
int stampMinute;
int WashOption;
};
int main()
{
ifstream FileIn;
FileIn.open("lab7.dat");
linkedQueueType<int> TicketQueue;
TicketInfo Customer;
TicketQueue.initializeQueue();
while(!FileIn.eof())
{
FileIn >> Customer.stampHour;
FileIn >> Customer.stampMinute;
FileIn >> Customer.WashOption;
TicketQueue.addQueue(Customer.stampHour);
TicketQueue.addQueue(Customer.stampMinute);
TicketQueue.addQueue(Customer.WashOption);
}
cout << "Customer # " << "Ticket Time " << "Option " << "Wash Time "<<
"Start Time " << "Finish Time " << "Wait Time\n";
while(!TicketQueue.isEmptyQueue())
{
}
system("pause");
return 0;
}
so I have built the queue, but stuck as to how to get a customer item from the queue and determine the wash and start times. Ive been reading through my textbooks for any references but could not find any. The functions that i need are left as an exercise in the book so no help there lol. I know i need the while loop which is empty at the moment. If anyone could offer any tips or suggestions, it will be greatly appreciated