static void Main(string[] args) { List<Question> questions = new List<Question>(); Question first = new Question() { Difficulty = 1, Vraag = "1+1", Antwoord = "2" }; ChoiceQuestion second = new ChoiceQuestion() { Difficulty = 3, Vraag = "In which country was the inventor of Java born?" }; second.AddChoice("Australia", false); second.AddChoice("Canada", true); second.AddChoice("Denmark", false); second.AddChoice("United States", false); Question third = new Question() { Difficulty=2, Vraag="10+10", Antwoord="20" }; questions.Add(first); questions.Add(second); questions.Add(third); Sortquestions(questions); foreach (Question x in questions) { Console.WriteLine(x.Difficulty); } Console.WriteLine("chose difficulty"); int Graad = Convert.ToInt32(Console.ReadLine()); questions = (from x in questions where x.Difficulty == Graad select x).ToList(); foreach (Question x in questions) { PresentQuestion(x); } }
static void Main(string[] args) { Question first = new Question(); first.SetText("Who was the inventor of Java?"); first.SetAnswer("James Gosling"); first.SetCategory("IT"); first.SetDifficulty(2); ChoiceQuestion second = new ChoiceQuestion(); second.SetText("In which country was the inventor of Java born?"); second.AddChoice("Australia", false); second.AddChoice("Canada", true); second.AddChoice("Denmark", false); second.AddChoice("United States", false); second.SetCategory("IT"); second.SetDifficulty(1); Console.WriteLine("Welke categorie wilt u?"); first.CategorySorter(); PresentQuestion(first); PresentQuestion(second); }