{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

bank - #include"bank.h#include #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 Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

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

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

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