Question: Redo the example shown in Listing 12.12, using the STL queue template class instead of the Queue class described in Chapter 12. Listing 12.12 bank.cpp

Redo the example shown in Listing 12.12, using the STL queue template class instead of the Queue class described in Chapter 12.

Listing 12.12 bank.cpp // bank.cpp -- using the Queue interface // compile

with queue.cpp #include #include // for rand() and srand() #include // for

time() #include "queue.h" const int MIN_PER_HR = 60; bool newcustomer (double x);

// is there a new customer? int main() { using std::cin; using

std::cout; using std::endl; using std::ios_base; // setting things up std::srand (std::time (0));

Listing 12.12 bank.cpp // bank.cpp -- using the Queue interface // compile with queue.cpp #include #include // for rand() and srand() #include // for time() #include "queue.h" const int MIN_PER_HR = 60; bool newcustomer (double x); // is there a new customer? int main() { using std::cin; using std::cout; using std::endl; using std::ios_base; // setting things up std::srand (std::time (0)); // random initializing of rand() cout < < "Case Study: Bank of Heather Automatic Teller "; cout < < "Enter maximum size of queue: "; int qs; cin >> qs; Queue line (gs); // line queue holds up to qs people cout < < "Enter the number of simulation hours: "; int hours; // hours of simulation. cin >> hours; // simulation will run 1 cycle per minute long cyclelimit = MIN_PER_HR hours; // # of cycles *

Step by Step Solution

3.38 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

ANSWER include include for rand and srand include for time include const int MINPERHR 60 bool newcus... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction Java Program Questions!