Advertisement
KodingKid

How to make a maths exam in C#

May 15th, 2021
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 KB | None | 0 0
  1. int correct = 0;
  2. int incorrect = 0;
  3. q1 = Console.ReadLine();
  4. Console.WriteLine("What is 92x28?");
  5. if q1 = "2576"
  6. {
  7.     print("Correct!");
  8.     correct + 1;
  9.     }
  10. if else
  11. {
  12.     print("Incorrect...");
  13.     incorrect + 1;
  14.     }
  15. q2 = Console.ReadLine();
  16. Console.WriteLine("What is 387+293?");
  17. if q2 = "680"
  18. {
  19.     print("Correct!");
  20.     correct + 1;
  21.     }
  22. if else
  23. {
  24.     print("Incorrect...");
  25.     incorrect + 1;
  26.     }
  27. q3 = Console.ReadLine();
  28. Console.WriteLine("What is 300/10?");
  29. if q3 = "30"
  30. {
  31.     print("Correct!");
  32.     correct + 1;
  33.     }
  34. if else
  35. {
  36.     print("Incorrect...");
  37.     incorrect + 1;
  38.     }
  39. q4 = Console.ReadLine();
  40. Console.WriteLine("What is 239-129?");
  41. if q1 = "164"
  42. {
  43.     print("Correct!");
  44.     correct + 1;
  45.     }
  46. if else
  47. {
  48.     print("Incorrect...");
  49.     incorrect + 1;
  50.     }
  51. q5 = Console.ReadLine();
  52. Console.WriteLine("What is 83x19?");
  53. if q5 = "1577"
  54. {
  55.     print("Correct!");
  56.     correct + 1;
  57.     }
  58. if else
  59. {
  60.     print("Incorrect...");
  61.     incorrect + 1;
  62.     }
  63. if (correct > incorrect)
  64.     Console.WriteLine("You passed!");
  65. if else
  66.     Console.WriteLine("You failed...");
  67. //for the python edition of this script... see here: https://pastebin.com/7vbjTCXC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement