using System;
namespace MultipleChoiceQuestion1
{
public class Program
{
enum TMCQuestion { One, Two, Three, Four, Five };
delegate char Question();
static char Sequence()
{
char Answer;
Console.WriteLine("Which sequence of numbers does not appear ");
Console.WriteLine("to follow a recognizable order?");
Console.WriteLine("(a) 3 9 27 33");
Console.WriteLine("(b) 3 6 9 12");
Console.WriteLine("(c) 2 4 6 8");
Console.WriteLine("(d) 102 204 408 816");
Console.Write("Your Answer? ");
Answer = char.Parse(Console.ReadLine());
return Answer;
}
static char Expression()
{
char Response;
Console.WriteLine(
"Select the best expression to complete the empty space");
Console.WriteLine(
"When ... drugs to a business address, traffickers often ");
Console.WriteLine("omit a recipient name");
Console.WriteLine("(a) to send");
Console.WriteLine("(b) senders");
Console.WriteLine("(c) sending");
Console.WriteLine("(d) dealing");
Console.Write("Your Answer? ");
Response = char.Parse(Console.ReadLine());
return Response;
}
static char Sentence()
{
char Answer;
Console.WriteLine("Even ... there are 76,000 lawyers in that city, ");
Console.WriteLine("it is still a small community");
Console.WriteLine("(a) although");
Console.WriteLine("(b) though");
Console.WriteLine("(c) for");
Console.WriteLine("(d) since");
Console.Write("Your Answer? ");
Answer = char.Parse(Console.ReadLine());
return Answer;
}
static char WrongWord()
{
char Wrong;
Console.WriteLine("Select the wrong word that would complete ");
Console.WriteLine("the sentence");
Console.WriteLine("For this type of business, revenue gains are ...");
Console.WriteLine("(a) limited");
Console.WriteLine("(b) scarce");
Console.WriteLine("(c) limitless");
Console.WriteLine("(d) claiming");
Console.Write("Your Answer? ");
Wrong = char.Parse(Console.ReadLine());
return Wrong;
}
static char Right()
{
char Sentence;
Console.WriteLine("Select the right sentence");
Console.WriteLine("(a) The company is expecting to reducing inventory,");
Console.WriteLine(" control cost, and efficiency improvement.");
Console.WriteLine("(b) The company expects to reduce inventory,");
Console.WriteLine(" control cost, and improve efficiency.");
Console.WriteLine("(c) The company expects to reduce inventory,");
Console.WriteLine(" control cost, and improving efficiency.");
Console.WriteLine("(d) The company is expecting to reducing inventory,");
Console.WriteLine(" controlling cost, and efficiency improvement.");
Console.Write("Your Answer? ");
Sentence = char.Parse(Console.ReadLine());
return Sentence;
}
static int Main()
{
const int NumberOfQuestions = 5;
char[] Answer = new char[NumberOfQuestions];
Question[] MCQ = new Question[NumberOfQuestions];
MCQ[0] = new Question(Sequence);
MCQ[1] = new Question(Expression);
MCQ[2] = new Question(Sentence);
MCQ[3] = new Question(WrongWord);
MCQ[4] = new Question(Right);
for (int i = 0; i < NumberOfQuestions; i++)
{
Console.WriteLine("Question {0}", i + 1);
Answer[i] = MCQ[i]();
ValidateAnswer(i + 1, Answer[i]);
Console.WriteLine();
}
return 0;
}
static void ValidateAnswer(int QstNbr, char Ans)
{
switch (QstNbr)
{
case 1:
if (Ans == 'a' || Ans == 'A')
Console.WriteLine("Right Answer");
else
{
Console.WriteLine("Wrong Answer - The right answer was 'a'");
Console.WriteLine("(a) Starting at 3, 3*3=9 and 3*9=27");
Console.WriteLine(" There is no obvious way to determine 33");
}
break;
case 2:
if (Ans == 'c' || Ans == 'C')
Console.WriteLine("Right answer");
else
Console.WriteLine("Wrong Answer - The right answer was 'c'");
break;
case 3:
if (Ans == 'b' || Ans == 'B')
Console.WriteLine("Right answer");
else
Console.WriteLine("Wrong Answer - The right answer was 'b'");
break;
case 4:
if (Ans == 'd' || Ans == 'D')
Console.WriteLine("Right answer");
else
Console.WriteLine("Wrong Answer - The right answer was 'd'");
break;
case 5:
if (Ans == 'b' || Ans == 'B')
Console.WriteLine("Right answer");
else
Console.WriteLine("Wrong Answer - The right answer was 'b'");
break;
default:
Console.WriteLine("Invalid Answer");
break;
}
}
}
}
|