using System.Collections.Generic;
static public void Main(string[] args)
var questions = GetEasyQuestions();
Console.WriteLine("Good luck there are " + questions.Count + " questions.");
while (answered < questions.Count)
var question = questions.ElementAt(answered);
Console.WriteLine(question.questiontext);
string answer = Console.ReadLine();
bool isANumber = int.TryParse(answer, out answerasnumber);
Console.WriteLine("thats not a number!");
if (answerasnumber == question.correctanswer)
Console.WriteLine("Correct!");
Console.WriteLine("Incorrect!");
Console.WriteLine("Well done you got " + score + "/" + questions.Count + " correct!");
public static List<Question> GetEasyQuestions()
return new List<Question>{new Question()
{questiontext = "1 + 1 = ", correctanswer = 2}, new Question()
{questiontext = "5 + 2 = ", correctanswer = 7}, new Question()
{questiontext = "8 + 3 = ", correctanswer = 11}, };
public static List<Question> GetHardQuestions()
return new List<Question>{new Question()
{questiontext = "1 + 1 = ", correctanswer = 2}, new Question()
{questiontext = "5 + 2 = ", correctanswer = 7}, new Question()
{questiontext = "8 + 3 = ", correctanswer = 11}, };
public string questiontext;
public int correctanswer;