Advertisement
saluxx

4 questions

Sep 9th, 2015
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.25 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication9
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int correctanswer = 0;
  14. int correctanswer1 = 0;
  15. int correctanswer2 = 0;
  16. int correctanswer3 = 0;
  17. Console.ForegroundColor = ConsoleColor.Green; // Ändra färg
  18. Console.WriteLine("Welcome");
  19. Console.ResetColor(); // Reseta färgen
  20. Console.WriteLine();
  21. Console.ForegroundColor = ConsoleColor.White;
  22. Console.WriteLine("You will be able to see a question with 3 different options");
  23. Console.WriteLine("type 1,2 or 3 depending on what the answer you believe it is.");
  24. Console.WriteLine();
  25. Console.Write("Correct answer = ");
  26. Console.ForegroundColor = ConsoleColor.Magenta;
  27. Console.Write("1");
  28. Console.ForegroundColor = ConsoleColor.White;
  29. Console.WriteLine(" Point");
  30. Console.WriteLine();
  31. Console.Write("Uncorrect answer = ");
  32. Console.ForegroundColor = ConsoleColor.Magenta;
  33. Console.Write("0");
  34. Console.ForegroundColor = ConsoleColor.White;
  35. Console.Write(" Points");
  36. Console.ResetColor();
  37. Console.WriteLine(); // Hoppar ner 1 rad
  38. Console.WriteLine();
  39. Console.WriteLine("Press any button to start the quiz");
  40.  
  41. Console.ReadKey();
  42. Console.Clear();
  43.  
  44. Console.WriteLine("What color is a banana?");
  45. Console.WriteLine("1 Black");
  46. Console.WriteLine("2 Yellow");
  47. Console.WriteLine("3 Green");
  48. Console.WriteLine("");
  49. string banan = Console.ReadLine();
  50. if (banan == "2")
  51. {
  52. correctanswer = 1;
  53. Console.WriteLine();
  54. Console.Write("The Right Answer is 2");
  55. Console.ForegroundColor = ConsoleColor.Yellow;
  56. Console.Write(" Yellow");
  57. Console.ResetColor();
  58. Console.WriteLine();
  59. Console.Write("Your Points: ");
  60. Console.ForegroundColor = ConsoleColor.Magenta;
  61. Console.Write(correctanswer);
  62. Console.ResetColor();
  63. Console.WriteLine();
  64. Console.WriteLine();
  65. Console.WriteLine("Press any button to continue");
  66. }
  67.  
  68. else
  69.  
  70. {
  71. correctanswer = 0;
  72. Console.Write("The Right Answer is 2");
  73. Console.ForegroundColor = ConsoleColor.Yellow;
  74. Console.Write(" Yellow");
  75. Console.ResetColor();
  76. Console.WriteLine();
  77. Console.Write("Your Points: ");
  78. Console.ForegroundColor = ConsoleColor.Magenta;
  79. Console.Write(correctanswer);
  80. Console.ResetColor();
  81. Console.WriteLine();
  82. Console.WriteLine();
  83. Console.WriteLine("Press any button to continue");
  84. }
  85.  
  86. Console.ReadKey();
  87. Console.Clear();
  88.  
  89. Console.WriteLine("Who created Minecraft?");
  90. Console.WriteLine("1 Adam Persson");
  91. Console.WriteLine("2 Lukas Persson");
  92. Console.WriteLine("3 Markus Persson");
  93. Console.WriteLine("");
  94. string minecraft = Console.ReadLine();
  95. if (minecraft == "3")
  96. {
  97. correctanswer1 = 1;
  98. Console.WriteLine();
  99. Console.WriteLine("The Right Answer is 3 Markus Persson");
  100. Console.Write("Your Points: ");
  101. Console.ForegroundColor = ConsoleColor.Magenta;
  102. Console.WriteLine(correctanswer + correctanswer1);
  103. Console.ResetColor();
  104. Console.WriteLine();
  105. Console.WriteLine("Press any button to continue");
  106.  
  107. }
  108.  
  109. else
  110.  
  111. {
  112. correctanswer1 = 0;
  113. Console.WriteLine("The Right Answer is 3 Markus Persson");
  114. Console.Write("Your Points: ");
  115. Console.ForegroundColor = ConsoleColor.Magenta;
  116. Console.WriteLine(correctanswer + correctanswer1);
  117. Console.ResetColor();
  118. Console.WriteLine();
  119. Console.WriteLine("Press any button to continue");
  120. }
  121. Console.ReadKey();
  122. Console.Clear();
  123.  
  124. Console.WriteLine("In which continent is Moçambique located?");
  125. Console.WriteLine("1 Africa");
  126. Console.WriteLine("2 Europe");
  127. Console.WriteLine("3 South America");
  128. Console.WriteLine("");
  129. string Mosambik = Console.ReadLine();
  130. if (Mosambik == "1")
  131. {
  132. correctanswer2 = 1;
  133. Console.WriteLine();
  134. Console.WriteLine("The Right Answer is 1 Africa");
  135. Console.Write("Your Points: ");
  136. Console.ForegroundColor = ConsoleColor.Magenta;
  137. Console.WriteLine(correctanswer + correctanswer1 + correctanswer2);
  138. Console.ResetColor();
  139. Console.WriteLine();
  140. Console.WriteLine("Press any button to continue");
  141.  
  142. }
  143.  
  144. else
  145.  
  146. {
  147. correctanswer2 = 0;
  148. Console.WriteLine();
  149. Console.WriteLine("The Right Answer is 1 Africa");
  150. Console.Write("Your Points: ");
  151. Console.ForegroundColor = ConsoleColor.Magenta;
  152. Console.WriteLine(correctanswer + correctanswer1 + correctanswer2);
  153. Console.ResetColor();
  154. Console.WriteLine();
  155. Console.WriteLine("Press any button to continue");
  156. }
  157.  
  158. Console.ReadKey();
  159. Console.Clear();
  160.  
  161. Console.WriteLine("What color is Cobalt?");
  162. Console.WriteLine("1 Blue");
  163. Console.WriteLine("2 Red");
  164. Console.WriteLine("3 Black");
  165. Console.WriteLine();
  166. String Cobalt = Console.ReadLine();
  167. if (Cobalt == "1")
  168. {
  169. correctanswer3 = 1;
  170. Console.WriteLine();
  171. Console.Write("The Right Answer is 1 ");
  172. Console.ForegroundColor = ConsoleColor.Blue;
  173. Console.Write("Blue");
  174. Console.ResetColor();
  175. Console.WriteLine();
  176. Console.Write("Your Points: ");
  177. Console.ForegroundColor = ConsoleColor.Magenta;
  178. Console.WriteLine(correctanswer + correctanswer1 + correctanswer2 + correctanswer3); // Press any button hoppar ner ett steg om du har write "line" här
  179. Console.ResetColor();
  180. Console.WriteLine();
  181. Console.WriteLine("Press any button to continue");
  182.  
  183. }
  184.  
  185. else
  186.  
  187. {
  188. correctanswer3 = 0;
  189. Console.WriteLine();
  190. Console.Write("The Right Answer is 1 ");
  191. Console.ForegroundColor = ConsoleColor.Blue;
  192. Console.Write("Blue");
  193. Console.ResetColor();
  194. Console.WriteLine();
  195. Console.Write("Your Points: ");
  196. Console.ForegroundColor = ConsoleColor.Magenta;
  197. Console.WriteLine(correctanswer + correctanswer1 + correctanswer2 + correctanswer3); // Press any button hoppar ner ett steg om du har write "line" här
  198. Console.ResetColor();
  199. Console.WriteLine();
  200. Console.WriteLine("Press any button to continue");
  201.  
  202. }
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211. Console.ReadKey();
  212. Console.WriteLine();
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230. }
  231. }
  232. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement