Advertisement
saluxx

new

Sep 9th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.20 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. Console.ForegroundColor = ConsoleColor.Green; // Ändra färg
  17. Console.WriteLine("Welcome");
  18. Console.ResetColor(); // Reseta färgen
  19. Console.WriteLine();
  20. Console.ForegroundColor = ConsoleColor.White;
  21. Console.WriteLine("You will be able to see a question with 3 different options");
  22. Console.WriteLine("type 1,2 or 3 depending on what the answer you believe it is.");
  23. Console.WriteLine();
  24. Console.Write("Correct answer = ");
  25. Console.ForegroundColor = ConsoleColor.Magenta;
  26. Console.Write("1");
  27. Console.ForegroundColor = ConsoleColor.White;
  28. Console.WriteLine(" Point");
  29. Console.WriteLine();
  30. Console.Write("Uncorrect answer = ");
  31. Console.ForegroundColor = ConsoleColor.Magenta;
  32. Console.Write("0");
  33. Console.ForegroundColor = ConsoleColor.White;
  34. Console.Write(" Points");
  35. Console.ResetColor();
  36. Console.WriteLine(); // Hoppar ner 1 rad
  37. Console.WriteLine();
  38. Console.WriteLine("Press any button to start the quiz");
  39.  
  40. Console.ReadKey();
  41. Console.Clear();
  42.  
  43. Console.WriteLine("What color is a banana?");
  44. Console.WriteLine("1 Black");
  45. Console.WriteLine("2 Yellow");
  46. Console.WriteLine("3 Green");
  47. Console.WriteLine("");
  48. string banan = Console.ReadLine();
  49. if (banan == "2")
  50. {
  51. correctanswer = 1;
  52. Console.WriteLine();
  53. Console.Write("The Right Answer is 2");
  54. Console.ForegroundColor = ConsoleColor.Yellow;
  55. Console.Write(" Yellow");
  56. Console.ResetColor();
  57. Console.WriteLine();
  58. Console.Write("Your Points: ");
  59. Console.ForegroundColor = ConsoleColor.Magenta;
  60. Console.Write(correctanswer);
  61. Console.ResetColor();
  62. Console.WriteLine();
  63. Console.WriteLine();
  64. Console.WriteLine("Press any button to continue");
  65. }
  66.  
  67. else
  68. {
  69. correctanswer = 0;
  70. Console.Write("The Right Answer is 2");
  71. Console.ForegroundColor = ConsoleColor.Yellow;
  72. Console.Write(" Yellow");
  73. Console.ResetColor();
  74. Console.WriteLine();
  75. Console.Write("Your Points: ");
  76. Console.ForegroundColor = ConsoleColor.Magenta;
  77. Console.Write(correctanswer);
  78. Console.ResetColor();
  79. Console.WriteLine();
  80. Console.WriteLine();
  81. Console.WriteLine("Press any button to continue");
  82. }
  83.  
  84. Console.ReadKey();
  85. Console.Clear();
  86.  
  87. Console.WriteLine("Vilken frukt gillar åsnor?");
  88. Console.WriteLine("1 Päron");
  89. Console.WriteLine("2 Äpple");
  90. Console.WriteLine("3 Drakfrukt");
  91. Console.WriteLine("");
  92. string åsnor = Console.ReadLine();
  93. if (åsnor == "3")
  94. {
  95. correctanswer1 = 1;
  96. Console.WriteLine("Rätt svar du fick 1 poäng");
  97. Console.WriteLine("Tryck för att fortsätta");
  98. Console.WriteLine(correctanswer + correctanswer1);
  99.  
  100. }
  101.  
  102. else
  103. {
  104. correctanswer1 = 0;
  105. Console.WriteLine("Fel svar du fick 0 poäng");
  106. Console.WriteLine("Tryck för att fortsätta");
  107. Console.WriteLine(correctanswer + correctanswer1);
  108. }
  109. Console.ReadKey();
  110. Console.Clear();
  111.  
  112. Console.WriteLine("I vilken värdsdel ligger Mosambik?");
  113. Console.WriteLine("1 Afrika");
  114. Console.WriteLine("2 Europa");
  115. Console.WriteLine("3 Sydamerika");
  116. Console.WriteLine("");
  117. string Mosambik = Console.ReadLine();
  118. if (Mosambik == "1")
  119. {
  120. correctanswer2 = 1;
  121. Console.WriteLine("Rätt svar du fick 1 poäng");
  122. Console.WriteLine("Tryck för att fortsätta");
  123. Console.WriteLine(correctanswer + correctanswer1 + correctanswer2);
  124.  
  125. }
  126.  
  127. else
  128. {
  129. correctanswer2 = 0;
  130. Console.WriteLine("Fel svar du fick 0 poäng");
  131. Console.WriteLine("Tryck för att fortsätta");
  132. Console.WriteLine(correctanswer + correctanswer1 + correctanswer2);
  133. }
  134.  
  135. Console.ReadKey();
  136. Console.WriteLine();
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154. }
  155. }
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement