/* TYPING TUTOR */ #include #include #include #include #include #include static int num; class type { private: public: type() { } void aim() //an introduction to the program { int i,j; clrscr(); randomize(); for(i=1;i<=10;i++) { j = random(3000); sound(j); delay(250); nosound(); } cout<<"\n\n\n\n\n\n\n\n\t\t\t\tHELLO ! DEAR STUDENT."; randomize(); for(i=1;i<=10;i++) { j = random(3000); sound(j); delay(400); nosound(); } clrscr(); cout<<"\n\n\n\n\n\n\n\n\t\t\t WELCOME TO TYPING TUTOR."; randomize(); for(i=1;i<=10;i++) { j = random(3000); sound(j); delay(400); nosound(); } //getch(); clrscr(); } //the function "aim()" ends here void rule() //the function "rule()" begins { int j; cout<<"\n\n\n\n\n\n\n\n\n\t\t\t\t "; for(j=1;j<=7;j++) cout<<"*"; cout<<"\n"; for(j=1;j<=3;j++) { if(j!=2) { cout<<"\t\t\t\t "; cout<<"* *"<<"\n"; } else { cout<<"\t\t\t\t "; cout<<"* "<95)&&(ch!=ctr)) { cout<<"\nYOU NEED TO WORK ON BOTH SPEED AND ACCURACY"; n++; } else { if((intvl>95)) { cout<<"\nYOU ARE A BIT SLOW.COME ON....BE QUICK."; n++; } if(ch!=ctr) { cout<<"\nYOU TYPED THE WRONG CHARACTER.BE CAREFUL NOW !"; n++; } } break; } case 2: { if((intvl>60)&&(ch!=ctr)) { cout<<"\nYOU NEED TO WORK ON BOTH SPEED AND ACCURACY"; n++; } else { if((intvl>60)) { cout<<"\nYOU ARE A BIT SLOW.COME ON....BE QUICK."; n++; } if(ch!=ctr) { cout<<"\nYOU TYPED THE WRONG CHARACTER.BE CAREFUL NOW !"; n++; } } break; } case 3: { if((intvl>23)&&(ch!=ctr)) { cout<<"\nYOU NEED TO WORK ON BOTH SPEED AND ACCURACY"; n++; } else { if((intvl>23)) { cout<<"\nYOU ARE A BIT SLOW.COME ON....BE QUICK."; n++; } if(ch!=ctr) { cout<<"\nYOU TYPED THE WRONG CHARACTER.BE CAREFUL !"; n++; } } break; } default : { cout<<"\nERROR !";break;} } if(n>3) n=3; switch(n) { case 0: break; case 1: { cout<<"\nYOU HAVE TWO CHANCES LEFT";break;} case 2: { cout<<"\nYOU HAVE ONLY ONE CHANCE LEFT";break;} case 3: { sleep(2);clrscr(); cout<<"\n\n\n\n\n\n\n\n\t\t\t GAME OVER !WELL PLAYED THOUGH.\n";sleep(5); clrscr(); cout<<"\n\n\n\n\n\n\n\n\t\t\t "<>vel; obj.go(); obj.watch(vel); getch(); } /* void main() {clrscr(); clock_t stt,end,ivl; stt=clock(); sleep(1); end=clock(); ivl=((end-stt)); cout<