Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.
I have the following Code. This is a simple quiz. I need to implement a loop and have the program score the quiz. How do I modify my code to
I have the following Code. This is a simple quiz. I need to implement a loop and have the program score the quiz. How do I modify my code to implement these two updates?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Quiz
{
class Program
{
static void Main(string[] args)
{
//Intro text
Console.WriteLine("Created by Brandon Borin");
Console.WriteLine("Welcome to the Math QUIZ!");
Console.WriteLine("ENGR115: CheckPoint 2");
//multiple choice question
Console.WriteLine("nQuestion 1. Multiple Choice");
Console.WriteLine("What is 1011101+1000000 (Boolean Math)");
Console.WriteLine("A. 11011101");
Console.WriteLine("B. 10101010");
Console.WriteLine("C. 11110001");
Console.WriteLine("D. 10011101");
Console.WriteLine("n");
Console.WriteLine("Please input A, B, C, or D.");
//this is where you read what the user inputs and assign it to a new string
string answer1 = Console.ReadLine();
//deciding answer based on input
if (answer1.ToUpper() == "D")
{
Console.WriteLine("***Correct!***");
Console.WriteLine("n Next Question...");
}
else
{
Console.WriteLine("***Wrong!***");
Console.WriteLine("n Next Question...");
}
//True or False question
Console.WriteLine("nQuestion 2. True or False:");
Console.WriteLine("When adding is 10010+1100 equal to 11110?");
Console.WriteLine("n Please input T for true, or F for False");
Console.WriteLine("n");
string answer2 = Console.ReadLine();
if (answer2.ToUpper() == "T")
{
Console.WriteLine("***Correct!***");
Console.WriteLine("n Next Question...");
}
else
{
Console.WriteLine("***Wrong!***");
Console.WriteLine("n Next Question...");
}
//multiple choice question
Console.WriteLine("nQuestion 3. Multiple Choice");
Console.WriteLine("What is 10011+1111101");
Console.WriteLine("A. 10010000");
Console.WriteLine("B. 11011100");
Console.WriteLine("C. 01100000");
Console.WriteLine("D. 10011000");
Console.WriteLine("n");
Console.WriteLine("Please input A, B, C, or D.");
//this is where you read what the user inputs and assign it to a new string
string answer3 = Console.ReadLine();
//deciding answer based on input
if (answer3.ToUpper() == "A")
{
Console.WriteLine("***Correct!***");
Console.WriteLine("n Next Question...");
}
else
{
Console.WriteLine("***Wrong!***");
Console.WriteLine("n Next Question...");
}
//True or False question
Console.WriteLine("nQuestion 4. True or False:");
Console.WriteLine("Is 1001100+1100101 equial to 10110001");
Console.WriteLine("n Please input T for true, or F for False");
Console.WriteLine("n");
string answer4 = Console.ReadLine();
if (answer4.ToUpper() == "T")
{
Console.WriteLine("***Correct!***");
Console.WriteLine("n Next Question...");
}
else
{
Console.WriteLine("***Wrong!***");
Console.WriteLine("n Next Question...");
}
//Multiple choice question
Console.WriteLine("nQuestion 5. Multiple Choice");
Console.WriteLine("Add 10011001 + 100111");
Console.WriteLine("A. 11100000");
Console.WriteLine("B. 11000000");
Console.WriteLine("C. 01100000");
Console.WriteLine("D. 11001000");
Console.WriteLine("n");
Console.WriteLine("Please input A, B, C, or D.");
//this is where you read what the user inputs and assign it to a new string
string answer5 = Console.ReadLine();
//deciding answer based on input
if (answer5.ToUpper() == "B")
{
Console.WriteLine("***Correct!***");
Console.WriteLine("n Next Question...");
}
else
{
Console.WriteLine("***Wrong!***");
Console.WriteLine("n Next Question...");
}
//multiple choice question
Console.WriteLine("nQuestion 6. Multiple Choice");
Console.WriteLine("Add 11000011 + 101111");
Console.WriteLine("A. 10110101");
Console.WriteLine("B. 01111011");
Console.WriteLine("C. 11010010");
Console.WriteLine("D. 11110010");
Console.WriteLine("n");
Console.WriteLine("Please input A, B, C, or D.");
//this is where you read what the user inputs and assign it to a new string
string answer6 = Console.ReadLine();
//deciding answer based on input
if (answer6.ToUpper() == "D")
{
Console.WriteLine("***Correct!***");
Console.WriteLine("n Next Question...");
}
else
{
Console.WriteLine("***Wrong!***");
Console.WriteLine("n Next Question...");
}
//True or False question
Console.WriteLine("nQuestion 7. True or False:");
Console.WriteLine("When adding in boolean is 0110+0111 equal to 1101?");
Console.WriteLine("n Please input T for true, or F for False");
Console.WriteLine("n");
string answer7 = Console.ReadLine();
if (answer7.ToUpper() == "T")
{
Console.WriteLine("***Correct!***");
Console.WriteLine("n Next Question...");
}
else
{
Console.WriteLine("***Wrong!***");
Console.WriteLine("n Next Question...");
}
//multiple choice question
Console.WriteLine("nQuestion 8. Multiple Choice");
Console.WriteLine("What is 0011+0111");
Console.WriteLine("A. 1010");
Console.WriteLine("B. 1111");
Console.WriteLine("C. 0101");
Console.WriteLine("D. 1100");
Console.WriteLine("n");
Console.WriteLine("Please input A, B, C, or D.");
//this is where you read what the user inputs and assign it to a new string
string answer8 = Console.ReadLine();
//deciding answer based on input
if (answer8.ToUpper() == "A")
{
Console.WriteLine("***Correct!***");
Console.WriteLine("n Next Question...");
}
else
{
Console.WriteLine("***Wrong!***");
Console.WriteLine("n Next Question...");
}
//True or False question
Console.WriteLine("nQuestion 9. True or False:");
Console.WriteLine("Is 1111+1010 equal to 101010");
Console.WriteLine("n Please input T for true, or F for False");
Console.WriteLine("n");
string answer9 = Console.ReadLine();
if (answer9.ToUpper() == "F")
{
Console.WriteLine("***Correct!***");
Console.WriteLine("n Next Question...");
}
else
{
Console.WriteLine("***Wrong!***");
Console.WriteLine("n Next Question...");
}
//Multiple choice question
Console.WriteLine("nQuestion 10. Multiple Choice");
Console.WriteLine("Add 1010 + 1010");
Console.WriteLine("A. 11000");
Console.WriteLine("B. 10101");
Console.WriteLine("C. 10100");
Console.WriteLine("D. 11100");
Console.WriteLine("n");
Console.WriteLine("Please input A, B, C, or D.");
//this is where you read what the user inputs and assign it to a new string
string answer10 = Console.ReadLine();
//deciding answer based on input
if (answer10.ToUpper() == "C")
{
Console.WriteLine("***Correct!***");
Console.WriteLine("n Next Question...");
}
else
{
Console.WriteLine("***Wrong!***");
}
}
}
}
m.____ ___ ____Hiiflorreettiifi Next Question... uestion 2. True or False: hen adding is 13313+1133 equal to 11113?for truefor False lease input T for true. or F for False mfluprgcttm |+ Next...