#include #include #include // note use of full path name here #include // again - a full path name is used const float SIMTIME = .5; // simulation time in hours const int MINUTES = 60; // number of minutes in an hour const float AMT_IN_TANK = 300; // initial gallons in the tank const float TODAYS_PRICE = 1.25; // price-per-gallon int main() { Pump a(AMT_IN_TANK, TODAYS_PRICE); // declare 1 object of type Pump Customer b; // declare 1 object of type Customer int totalTime = 0; int idleTime; int amtRequest; int SimMinutes; // simulation time in minutes SimMinutes = SIMTIME * MINUTES; cout << "\nStarting a new simulation - simulation time is " << SimMinutes << " minutes" << endl; a.values(); // get the first arrival idleTime = b.arrive(); totalTime += idleTime; while (totalTime <= SimMinutes) { cout << "\nThe idle time is " << idleTime << " minutes" << endl << " and we are " << totalTime << " minutes into the simulation." << endl; amtRequest = b.gallons(); a.request(float(amtRequest)); // get the next arrival idleTime = b.arrive(); totalTime += idleTime; } cout << "\nThe idle time is " << idleTime << " minutes." << endl << "As the total time now exceeds the simulation time, " << endl << " this simulation run is over." << endl; return 0; }