The goalis to build a quiz that will keep score. However, after the first run through the user need to have a second go around for the questions answered wrong.
How do I....
1. buid a scorecard that will give only the number of correct answers out of 10, ie.. 2 of 10, 8 of 10.
2. Create a second run through for the questions that were answered wrong
<pre>using System;
using System.Linq;
namespace Checkpoint_3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Quiz");
bool answerCorrect = false;
string[] questions = { "2+2=", "4x5=", "8+2=", "2x100=", "3+3=", "2+100", "2-2=", "1+2=", "3x3=15", "45-5+8=48" };
string[] answers = { "a.4 b.2 c.6 d. 10", "a.40 b.20 c.16 d. 11", "a.6 b.12 c.16 d. 10", "a.104 b.200 c.65 d. 102", "a.4 b.2 c.6 d. 10", "a.14 b.200 c.60 d. 102", "a.4 b.2 c.0 d. 10", "a.3 b.2 c.6 d. 102", "true false", " true false" };
string [] correctanswer = { "a", "b", "d", "b", "c", "d", "c", "a", "false", "true" };
int[] scoreCard = { };
Console.WriteLine("Ryan Hinds, ENGR101- Quiz");
Console.WriteLine();
for (int i = 0; i < 10; i++)
{
Console.WriteLine(questions[i]);
Console.WriteLine();
Console.WriteLine(answers[i]);
Console.WriteLine("Answer");
string input = Console.ReadLine(); char letter; char.TryParse(input, out letter);
if (input==correctanswer[i])
{
Console.WriteLine(" You Are Correct");
Addscore(scoreCard[i]);
}
else
Console.WriteLine("Wrong");
Console.WriteLine();
Console.WriteLine();
}
Console.ReadKey();
}
}
}
What I have tried:
I've gotten the first part up and running