C# Multiple Choice Project Create a program with two multiple choice questions. 1. Users have two attempts only, show attempt number each time. Hint: while loop with break control. (20%) 2. Only one correct answer for each question, use switch case for each question. (20%) 3. Show total score after the two questions are answered. Hint: if…else if…else. (20%) 4. User have options to answer the two questions again if first attempt score is not 100%. Hint: if statment. (20%) 5. Use string method .ToUpper() to allow users to enter with lowercase or uppercase letters. (20%) 1. Where is the capital of the state of Florida? A. Orlando B. Tallahassee C. Miami D. Tampa Answer: B 2. Where is Walt Disney World Park located in Florida? A. Orlando B. Tallahassee C. Miami D. Tampa Answer: a The code must show if I got one answer correct and the other wrong it would be 50% and allow another attempt if the user has not exhausted the two attempts. Spacing is needed between the question and answers.
Expert Answer
using System;
class Program
{
static void Main()
{
int attempt=0,score=0;;
while(attempt!=2)
{
int question=1;
string input;
switch(question)
{
case 1:
case 2: Console.WriteLine(“1. Where is the Capital of state of Florida?”);
Console.WriteLine(“A. Orlando”);
Console.WriteLine(“B. Tallahassee”);
Console.WriteLine(“C. Miami”);
Console.WriteLine(“D. Tampa”);
Console.WriteLine(“Ans: “);
input = Console.ReadLine();
score=0;
if((input.ToUpper()).Equals(“B”))
score=score+50;
else score=0;
question++;
Console.WriteLine(“1. Where is Walt disney World Park in Florida?”);
Console.WriteLine(“A. Orlando”);
Console.WriteLine(“B. Tallahassee”);
Console.WriteLine(“C. Miami”);
Console.WriteLine(“D. Tampa”);
Console.WriteLine(“Ans: “);
input = Console.ReadLine();
if((input.ToUpper()).Equals(“A”))
score=score+50;
else score=50;
attempt++;
Console.WriteLine(“Your attempt is: {0}”,attempt);
break;
}
if(score==100)
{
break;
}
//else attempt++;
}
Console.WriteLine(“Your score is: {0}”,score);
}
}