cout<<"\n\nPC RENTAL APPLICATION";
cout<<"\n\nCREATED BY: ME";
cout<<"\n\nPRESS ENTER TO CONTINUE";
cout<<"\n\nPRESS ESC TO EXIT";
ans = getch();
if (ans==13)
{
type1();
}
if (ans==27)
{
}
}
void type1(void)
{
dforce f;
char code;
rep:
clrscr();
cout<<"\n\n\DragonForce Computer Shop";
cout<<"\n\nRATE: 1 PHP = 1 MINUTE";
cout<<"\n\nPCs Available";
cout<<"\n\n\nPC[1]\t\tPC[2]";
cout<<"\n\nPC[3]\t\tPC[4]";
cout<<"\n\n[Enter PC # you wish to activate or Enter x if you want to exit]";
cout<<"\n\n\nEnter choice here --> ";
cin>>code;
if (code == 'x' || code == 'X')
{
goto exit;
}
clrscr();
switch(code)
{
case '1': cout<<"\n\n\n\n\n\n\n--PC NUMBER 1 ACTIVATED--";
cout<<"\n(Press any key to continue)";
f.work();break;
case '2': cout<<"\n\n\n\n\n\n\n--PC NUMBER 2 ACTIVATED--";
cout<<"\n(Press any key to continue)";
f.work();break;
case '3': cout<<"\n\n\n\n\n\n\n--PC NUMBER 3 ACTIVATED--";
cout<<"\n(Press any key to continue)";
f.work();break;
case '4': cout<<"\n\n\n\n\n\n\n--PC NUMBER 4 ACTIVATED--";
cout<<"\n(Press any key to continue)";
f.work();break;
default : cout<<"\n\n\nINVALID PC. PLEASE TRY AGAIN ";
goto rep;
exit:
}
}
Sorry for not using [code] and all of those. I don't know how to use them in the forum.
Now to my problems.
First, I do not know why my timer/clock needs me to press enter just for it to add 1 second.
Next, I do not know why I can't press esc when my timer/clock is doing it's function.
Third, how can I start the timer for a PC go to the main menu start the time for a different PC then go back to the menu then when I go back to the first PC I have set the time for, the time shouldn't go back to 0. It should still be running.
Lastly, how can I forcefully stop the clock so that when I press a certain key. The timer would go back to 0.