Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.14 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #define SIZE 10
  4. #include <stdlib.h>
  5. #include <string.h>
  6.  
  7. void Level1();
  8. void Level2();
  9.  
  10. int main ()
  11. {
  12. printf("Welcome to Disney Quiz Game ! Let's win $$$\n\n");
  13.  
  14. Level1();
  15.  
  16. system("pause");
  17. return 0;
  18. }
  19. void Level1()
  20. {
  21. char question[SIZE][1000]={"In Aladdin, what is the name of Jasmine's pet tiger?\n\nA-Rajah\nB-Meow\nC-Cat\nD-Snow",
  22. "In Peter Pan, Captain Hook had a hook on which one of his hands?\n\nA-Left\nB-Right\nC-None\nD-Both hand",
  23. "In Beauty and the Beast, how many eggs does Gaston eat for breakfast?\n\nA-5 dozen\nB-6 dozen\nC-7 dozen\nD-8 dozen",
  24. "After being on earth, where did Hercules first meet his father Zeus?\n\nA-Temple\nB-Home\nC-Mosque\nD-Shopping Mall",
  25. "The fairygodmother turn the ___ into a carriage.\n\nA-Pumpkin\nB-Lizard\nC-Cabbage\nD-Mice",
  26. "Who was the first Disney princess?\n\nA-Belle\nB-Snow White\nC-Cinderella\nD-Arielle",
  27. "What is the name of snowman in Frozen?\n\nA-Kristoff\nB-Hans\nC-Olaf\nD-Olive",
  28. "In Toy Story, who owns Woody?\n\nA-Toms\nB-Andy\nC-Billy\nD-Hendry",
  29. "Which Disney classic has a talking mirror which is asked 'Mirror mirror on the wall' ?\n\nA-Cinderella\nB-Alice In The Wonderland\nC-Sleeping Beauty\nD-Snow White",
  30. "Which Disney princess attempts to disguise herself as a man?\n\nA-Mulan\nB-Tiana\nC-Jasmine\nD-Rapunzell"};
  31. char answer[SIZE]={'A','A','A','A','A','B','C','B','D','A'};
  32.  
  33. char choice, lifeline, y;
  34. int x=1, prize=200, n;
  35.  
  36. do{
  37. srand(time(NULL));
  38. fflush(stdin);
  39.  
  40. n=strcmpi(question[x],question[x-1]) ;
  41. if(n!=0)
  42. {
  43. printf("Question #%d is worth RM200. The question is : \n-%s\n",x++, question[y=rand()%9],SIZE);
  44. }
  45. printf("You can also choose:\n");
  46. printf("E- Stop playing (and walk away with RM)\nF-Use a lifeline\n");
  47. printf("\nWhat is your answer: ");
  48. scanf("%c", &choice);
  49. choice=toupper(choice);
  50.  
  51. if(choice==answer[y])
  52. printf("Congratulation!\nYour current winning is RM%d\n\n", prize);
  53. else if(choice=='E')
  54. printf("You have ended the game. You won RM%d. Thank you for playing!\n", prize);
  55. else if(choice=='F')
  56. do{
  57. printf("Tipoff-T or NewQuest-Q ? :");
  58. scanf("%c",&lifeline);
  59.  
  60. if(lifeline=='T')
  61. printf("\nTipoff\n");
  62. else if (lifeline=='Q')
  63. printf("\nNewQuest\n");
  64. else
  65. printf("\nInvalid\n");
  66.  
  67. }while(lifeline!='T' && lifeline!='Q');
  68. else
  69. {
  70. printf("Sorry wrong answer. Game over\n");
  71. return 0;
  72. }
  73.  
  74. prize+=200;
  75.  
  76. }while(choice==answer[y]&& x<6);
  77.  
  78. printf("Do you want to continue?");
  79. if(x==6&&choice==answer[y]);
  80. Level2();
  81.  
  82. }
  83. void Level2()
  84. {
  85. char question[SIZE][1000]={"What Disney Film contains the classic song 'Be Our Guest'?\n\nA-Sleeping Beauty\nB-Monster Inc\nC-Beauty And The Beast\nD-Lion King",
  86. "Which film will you find the characters The Lost Boys?\n\nA-Monster Inc\nB-Peter Pan\nC-The Jungle Book\nD-Merlin",
  87. "Which Disney cub can not wait to be a King?\n\nA-Kristoff\nB-Simba\nC-Nala\nD-Mufasa",
  88. "What is Aladdin's main type of magical transport?\n\nA-Magic Lamp\nB-Flying Tile\nC-Leaves\nD-Magic Carpet",
  89. "In Sleeping Beauty and Snow White, the main characters are awaken by the same act- what is it?\n\nA-A prince's kiss\nB-A warm hug\nC-Sleeping\nD-Drink magic water",
  90. "What Disney film has an Elastic Girl and An Iceman?\n\nA-Frozen\nB-Toy Story\nC-The Incredibles\nD-Monster Inc",
  91. "What colour are the Mickey Mouse's shorts?\n\nA-White\nB-Black\nC-Red\nD-Pink",
  92. "In the movie Finding Nemo, which country has Nemo been taken to?\n\nA-Singapore\nB-Australia\nC-Paris\nD-China",
  93. "What is the name of Donald Duck's sister?\n\nA-Daisy Duck\nB-Scrooge Mc Duck\nC-Dumbella\nD-He has no sister",
  94. "For the first time in forever, there'll be music there'll be fun.... What Disney movie is related to this song?\n\nA-Aladdin\nB-Frozen\nC-Beauty And The Beast\nMoana"};
  95. char answer[SIZE]={'C','B','B','D','A','C','C','B','C','B'};
  96.  
  97. char choice, lifeline, y;
  98. int x=1, prize=400;
  99.  
  100. do{
  101. srand(time(NULL));
  102. fflush(stdin);
  103.  
  104. printf("Question for Level 2 worth RM400. Let's play!\n");
  105. printf("Q%d-%s\n",x++, question[y=rand()%9],SIZE);
  106. printf("You can also choose:\n");
  107. printf("E- Stop playing (and walk away with RM)\nF-Use a lifeline\n");
  108. printf("\nWhat is your answer: ");
  109. scanf("%c", &choice);
  110. choice=toupper(choice);
  111.  
  112. if(choice==answer[y])
  113. printf("Congratulation!\nYour current winning is RM%d\n\n", prize);
  114. else if(choice=='E')
  115. printf("You have ended the game. You won RM%d. Thank you for playing!\n", prize);
  116. else if(choice=='F')
  117. do{
  118. printf("Tipoff-T or NewQuest-Q ? :");
  119. scanf("%c",&lifeline);
  120.  
  121. if(lifeline=='T')
  122. printf("\nTipoff\n");
  123. else if (lifeline=='Q')
  124. printf("\nNewQuest\n");
  125. else
  126. printf("\nInvalid\n");
  127.  
  128. }while(lifeline!='T' && lifeline!='Q');
  129. else
  130. {
  131. printf("Sorry wrong answer. Game over\n");
  132. }
  133.  
  134. prize+=400;
  135.  
  136. }while(choice==answer[y]&&x<6);
  137.  
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement