bank - #include "bank.h" #include...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include "bank.h" #include <iostream> #include <fstream> void CBank::Run () { ifstream inFile ("in.dat"); if (inFile.fail()) { cerr << "File not found." << endl; } ofstream outFile ("out.dat"); outFile << "Time 0. Simulation begins" << endl; fCurOutsideCustomer = GetNextCustomer (inFile); bool done = false; while (!done) { if (fTeller->Update()) ProcessDepartingCustomer(outFile); fCurServedCustomer = fTeller->GetCurrentCustomer(); if (fLine->empty()) fCurFrontOfQCustomer = NULL; else fCurFrontOfQCustomer = fLine->front(); { ProcessWaitingCustomer(outFile); } { ProcessArrivingCustomer(outFile); fCurOutsideCustomer = GetNextCustomer (inFile); } done = true; else fClock->Advance(); } outFile << "Total number of customers: " << fNumCustomers << endl; outFile << "Total waiting time: " << fTotalWaitingTime << " time units" <<
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/17/2012 for the course CSC 1254 taught by Professor Blanks,l during the Fall '08 term at LSU.

Page1 / 2

bank - #include &quot;bank.h&quot; #include...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online