Hello,
I am a beginner in coding in C# and really to coding in general. I am creating a quiz program and am having a problem getting it to generate a score. I am pretty sure I need to use and array but I do not understand where to place it and how to get the rest of the program to feed into it. Below is an example of my program. Any help would be greatly appreciated.
I am a beginner in coding in C# and really to coding in general. I am creating a quiz program and am having a problem getting it to generate a score. I am pretty sure I need to use and array but I do not understand where to place it and how to get the rest of the program to feed into it. Below is an example of my program. Any help would be greatly appreciated.
public class Program { public static void Questionone() { Start: Console.Write("Q1: The Wright Brothers made their first flight at Kittyhawk North Carolina\n 1) True 2) False\n"); int answer1 = Convert.ToInt32(Console.ReadLine()); Console.ReadKey(); if (answer1 < 1 || answer1 > 2) { Console.WriteLine("This was not one of the choices"); goto Start; } else { String message1 = (answer1 != 1) ? "Incorrect" : "Correct"; Console.WriteLine(message1); Console.WriteLine(); } } public static void Questiontwo() { Start: Console.Write("Q2: What feat is Chuck Yeager most famous for?\n 1) Being a Pilot 2) Being a WWII Ace 3) Breaking the sound barrier 4) Being the first man in space\n"); int answer2 = Convert.ToInt32(Console.ReadLine()); Console.ReadKey(); if (answer2 < 1 || answer2 > 4) { Console.WriteLine("This was not one of the Choices"); goto Start; } else { String message2 = (answer2 != 3) ? "Incorrect" : "Correct"; Console.WriteLine(message2); Console.WriteLine(); } } public static void Questionthree() {