Ne programin C++ bashkengjitur e ndertuar si detyre mesohen thirrjet e funksioneve ne nje program te nivelit mesatar. Programi tregon kohen e pritjes per meshkujt dhe per femrat per te perdorur VC publike.
cfunksionet-detyra-program.rar
Tirana Center of Technology
——–driver.cpp———————-
#include<string>
#include<iostream>
#include<fstream>
//the library when we use the clock and random number function
#include “Patron.h”
#include “Restroom.h”
#include “Input.h”
#include “Output.h”
#include “assign6.h”
using namespace std;
int main()
{
ofstream fout;
fout.open(“output.dat”);
int counter = 0;
do
{
//output
Output simOutputs;
simOutputs.numMenAttendingRest = 0;
simOutputs.numWomenAttendingRest = 0;
simOutputs.numMenUseRest = 0;
simOutputs.numWomenUseRest = 0;
simOutputs.totalMenWaitTime = 0;
simOutputs.totalWomenWaitTime = 0;
simOutputs.menLine = 0;
simOutputs.womenLine = 0;
Input simInputs;
int clock = 0;
double arrivalProbM, arrivalProbF;
Patron pF, pM;
getInput(simInputs, counter);
Restroom womenRoom(simInputs.numFemaleStalls), menRoom(simInputs.numMaleStalls);
arrivalPropability(simInputs, arrivalProbM, arrivalProbF);
for (clock; clock < simInputs.eventLength; clock++)
{
checkFemaleArrival(arrivalProbF, womenRoom, clock, pF, simOutputs);
checkMaleArrival(arrivalProbM, menRoom, clock, pM, simOutputs);
womenRoom.updateStalls();
menRoom.updateStalls();
femaleStallAvailable(womenRoom, pF, clock, simOutputs);
maleStallAvailable(menRoom, pM, clock, simOutputs);
}
//yetInLine(simOutputs);
displayOutput(counter, simInputs, simOutputs, menRoom, womenRoom);
}while(reGetInput());
fout.close();
return 0;
}
————————————————————