Im trying to write a code for a class that has 20 activities .. each activity has a start time and a finish time.
When i try to generate the times the start time is larger than the finish in some cases. can any one help me with my function error.. im trying to get all the start times random other than 0 and smaller than the finish and pass to my set and get funtions in main.
int randomStart(int x)
{
int a;
int q;
x= 0+rand()%(69-0)+1;
q = randomFinish(a);
while(x>q)
{
x= rand()%69;
q = randomFinish(a);
//return x;
}
return x;
}
int randomFinish(int y)
{
y = 1 + rand()%70;
return y;
}