using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Expressions_and_Statements
{
class Program
{
static void Main(string[] args)
{
string choice;
string firstAnswer;
string secondAnswer;
string thirdAnswer;
int answersCorrect = 0;
int positive = 1;
Console.Title = "C# Quiz!";
Console.WriteLine("Hello And Welcome to the C# Quiz!!");
Console.ReadKey();
Console.Clear();
Console.WriteLine("Are you Ready?");
Console.WriteLine("Y/N");
choice = Console.ReadLine();
switch (choice)
{
case "Y":
case "y":
choice = "Lets Begin!";
break;
case "N":
case "n":
choice = "Maybe Next Time!";
break;
}
Console.WriteLine(choice);
Console.Clear();
Console.WriteLine("How do Make a Backslash in C#?");
Console.Write(@"
____________________
1. \\
2. \*
3. \0
4. \''
____________________");
Console.WriteLine("What is your Answer? Type in the Number!");
firstAnswer = Console.ReadLine();
switch (firstAnswer)
{
case "1":
firstAnswer = "Correct!";
answersCorrect = positive++;
break;
case "2":
firstAnswer = "Incorrect!";
break;
case "3":
firstAnswer = "Incorrect!";
break;
case "4":
firstAnswer = "Incorrect!";
break;
}
Console.WriteLine(firstAnswer);
Console.WriteLine("You Have " + answersCorrect + " out of 5 correct!");
Console.ReadKey();
Console.Clear();
if (firstAnswer == "Correct!")
{
Console.WriteLine("Now for Question 2.");
Console.ReadKey();
Console.Clear();
Console.WriteLine("How do you Declare an Integer?");
Console.WriteLine(@"
___________________
1. bool
2. string
3. int
4. char
___________________");
}
secondAnswer = Console.ReadLine();
switch (secondAnswer)
{
case "1":
secondAnswer = "Incorrect!";
break;
case "2":
secondAnswer = "Incorrect!";
break;
case "3":
secondAnswer = "Correct!";
answersCorrect = +positive++;
break;
case "4":
secondAnswer = "Incorrect!";
break;
}
Console.ReadKey();
Console.Clear();
Console.WriteLine(secondAnswer);
Console.WriteLine("You Have " + answersCorrect + " out of 5 correct!");
Console.ReadKey();
if (secondAnswer == "Correct!")
{
Console.WriteLine("Now its time for Question 3!");
Console.ReadKey();
Console.Clear();
Console.WriteLine("What word is used to declare true/false variables?");
Console.WriteLine(@"
___________________
1. ^=
2. bool
3. &&
4. %
___________________");
}
thirdAnswer = Console.ReadLine();
switch (thirdAnswer)
{
case "1":
thirdAnswer = "Incorrect!";
break;
case "2":
thirdAnswer = "Correct!";
answersCorrect = positive++;
break;
case "3":
thirdAnswer = "Incorrect";
break;
case "4":
thirdAnswer = "Incorrect!";
break;
}
Console.ReadKey();
Console.Clear();
Console.WriteLine(thirdAnswer);
Console.WriteLine("You have " + answersCorrect + " out of 5 Correct!");
Console.ReadKey();
}
}
}
This is a Console Quiz App I made because i wanted to get back programming again. its not complete but it might as well be. And its written in C#