In the title are the two errors I get when compiling. The code is as follows
Thanks for any help that can be given.
Code:
int main()
{
int runs;
double high=0;
double remaining=0;
double fremaining=0;
int count=0; // count the # of times we reach out goal
int progress=0;
int h,r;
srand((unsigned)time(NULL)); // seed random # generator
printf("[....................]");
for (runs=0;runs<NUMRUNS;runs++)
{
if (20*(runs+1)/NUMRUNS>progress)
{
progress=20*(runs+1)/NUMRUNS;
printf("\r[");
for(int x=0;x<progress;x++)
printf("*");
}
start(h,r);
high+=h;
remaining+=r/NUMRUNS; // Compute a running average of remaining meat
if (r>=GOALMONEY)
count++;
else
fremaining+=r;
}
high/=NUMRUNS;
if (NUMRUNS-count>0)
fremaining/=NUMRUNS-count;
printf("\n\nStarted with %dk. ",STARTINGMONEY/1000);
if (GOALMONEY>0)
printf("Set a goal of %dk. ",GOALMONEY/1000);
printf("Ran %d times.\nGot up to an average %dk.\nEnded up with an average %dk.\n",NUMRUNS,int(high/1000),int(remaining/1000));
if (GOALMONEY>0)
{
if (NUMRUNS-count>0)
printf("Failures ended up with an average %dk.\n",int(fremaining/1000));
printf("You reached your goal %f%% of the time.\n\n",(100*double(count)/NUMRUNS));
}
system("pause");
return 0;
}
Comment