Function call not working
Why isn't this function call working?
time = CalculateTime(service);
Code:
//******************************************************************//
//Program Queue client file //
// //
// //
// //
// //
// //
// //
//******************************************************************//
#include<iostream>
#include<iomanip>
#include<fstream>
#include <cctype> // defines isalpha() function
#include<string>
#include <time.h>
#include <cstdlib>
using namespace std;
#include"QueueImple.cpp"
int CalculateTime(int service);
int main()
{
queueList Lines;
sortedList Words;
ifstream Infile;
ofstream Outfile;
Infile.open("inputQ.txt");
Outfile.open("OUTPUTQ.TXT");
int y = rand();
int x = rand();
int minutes = 720;
int Seed, arrive, service;
int customer = 0;
int CustomerNumber=0;
int runningtime;
int time=0;
srand(Seed);
y = rand();
x = rand();
Infile>>customer;
while(customer < 5)
{
srand(customer);
arrive = rand()%100; //First cutsomer arrival time
service = rand()%100; //First customer service time
CustomerNumber++;
Outfile<<"Customer "<<CustomerNumber<<endl;
Outfile<<"Customer "<<CustomerNumber<<" arrival time "<<arrive<<endl;
Outfile<<"Customer "<<CustomerNumber<<" service time "<<service<<endl;
time = CalculateTime(service);
Outfile<<time;
Infile>>customer;
}
/*srand((unsigned)time(NULL)); //Casts time's return to unsigned
int d=rand()%12; //Should be more random now
Outfile<<d;
*/
return 0;
}
int CalculateTime(int service)
{
int minutes= 720;
int time;
{
while(minutes > 0)
service++;
minutes--;
}
time = service;
return time;
}