#include#include#include “); printf(” ——————————- “); choice=toupper(getch()); if (choice==’V’)

#include#include#include #include#include#include#includevoid displayscore() { char name20; float s; FILE *f; system(“cls”); f=fopen(“score.txt”,”r”); fscanf(f,”%s%f”,&name,&s); printf(”

“); printf(”

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

%s has secured the Highest Score %.2f”,name,s); printf(”

“); fclose(f); getch(); }void help() { system(“cls”); printf(”

This game is very easy to play. You’ll be asked some general”); printf(”

knowledge questions and the right answer is to be chosen among”); printf(”

the four options provided. Your score will be calculated at the”); printf(”

end. Remember that the more quicker you give answer the more”); printf(”

score you will secure. Your score will be calculated and displayed”); printf(”

at the end and displayed. If you secure highest score, your score”); printf(”

will be recorded. So BEST OF LUCK.”); }void writescore(float score, char plnm20) { float sc; char nm20; FILE *f; system(“cls”); f=fopen(“score.txt”,”r”); fscanf(f,”%s%f”,&nm,&sc); if (score>=sc)   { sc=score;     fclose(f);     f=fopen(“score.txt”,”w”);     fprintf(f,”%s
%.2f”,plnm,sc);     fclose(f);   } }int main()     {     int countq,countr;     int r,i;     int pa;int nq6;int w;     float score;     char choice;     char playername20;     time_t initialtime,finaltime;     system(“cls”);     //randomize();     mainhome:     system(“cls”);     puts(”
WELCOME TO I.Q. TEST PROGRAM

“) ;     puts(”
——————————-“);     puts(”
Enter ‘S’ to start game       “);     puts(”
Enter ‘V’ to view high score  “);     puts(”
Enter ‘H’ for help            “);     puts(”
Enter ‘Q’ to quit             “);     printf(”
——————————-

  “);     choice=toupper(getch());     if (choice==’V’) { displayscore(); goto mainhome; }     else if (choice==’Q’) exit(1);     else if (choice==’H’) { help(); getch(); goto mainhome; }    else if(choice==’S’){     system(“cls”);     printf(”

Enter your name…”);     printf(”
(only one word)

“);     gets(playername);     home:     system(“cls”);     initialtime=time(NULL);     countq=countr=0;     i=1;     start:     srand ( time(NULL) );     r=rand()%23+1;     nqi=r;     for (w=0;w=80 && score=60 &&score=40 && score

Go Top
x

Hi!
I'm Eleanor!

Would you like to get a custom essay? How about receiving a customized one?

Check it out