public void AnswerQuizBinary(int score) { Quizelement quizBinary = new Quizelement(); quizBinary.question = "Stimmt es, dass bei der Mischung von Gelb und Rot Orange ergeben?"; Console.WriteLine(quizBinary.question); Console.WriteLine("Beantworte die Frage mit J bzw N"); string UserInput = Console.ReadLine(); if (UserInput == "J") { Console.WriteLine("Korrekt"); score++; } else { Console.WriteLine("Falsch"); } Program p = new Program(); p.QuizMenu(score); }
public void AnswerQuizGuess(int score) { Quizelement quizGuess = new Quizelement(); quizGuess.question = "Schätze, wie viele Studenten die HFU hat."; Console.WriteLine(quizGuess.question); Console.WriteLine("Gib eine Zahl ein:"); double number = double.Parse(Console.ReadLine()); double toleranceMin = 6687 * 0.09; double toleranceMax = 6687 * 1.1; if (number >= toleranceMin && number <= toleranceMax) { Console.WriteLine("Korrekt"); score++; } else { Console.WriteLine("Falsch"); } Program p = new Program(); p.QuizMenu(score); }
public void AnswerQuizFree(int score) { Quizelement quizFree = new Quizelement(); quizFree.question = "Führe die Redewendung fort: Wer den Cent nicht ehrt,..."; Console.WriteLine(quizFree.question); Console.WriteLine("Deine Antwort ist: "); string rightWord = Console.ReadLine(); if (rightWord == "ist den Euro nicht wert") { Console.WriteLine("Korrekt"); score++; } else { Console.WriteLine("Falsch"); } Program p = new Program(); p.QuizMenu(score); }
public static void SolveAQuestion(Quizelement quizelemente) { quizelemente.ShowQuestion(); Console.Write("\nYour choice: "); if (quizelemente.answers[Int32.Parse(Console.ReadLine()) - 1].isTrue()) { score += 10; Console.Write("\nRight!"); } else { Console.Write("\nWrong!"); } currentQuizelement++; }
public void AnswerQuizMultiple(int score) { Quizelement quizMultiple = new Quizelement(); quizMultiple.question = "Wer war schon einmal Politiker?"; string[] answers = new string[6]; answers[0] = "Barak Obama"; answers[1] = "Helmut Kohl"; answers[2] = "Helene Fischer"; answers[3] = "Justin Bieber"; answers[4] = "Konrad Adenauer"; answers[5] = "Elyas M'Barek"; Console.WriteLine(quizMultiple.question); Console.WriteLine(answers[0]); Console.WriteLine(answers[1]); Console.WriteLine(answers[2]); Console.WriteLine(answers[3]); Console.WriteLine(answers[4]); Console.WriteLine(answers[5]); Console.WriteLine("Wähle die richtige Antwort:"); string selectedAnswers = Console.ReadLine(); string[] answer = selectedAnswers.Split(','); if (answer [0] == "1" && answer[1] == "2" && answer[2] == "4") { Console.WriteLine("Korrekt"); score++; } else { Console.WriteLine("Falsch"); } Program p = new Program(); p.QuizMenu(score); }
public void AnswerQuizSingle(int score) { Quizelement quizSingle = new Quizelement(); quizSingle.question = "Wer war der erste Bundeskanzler der BRD?"; string[] answers = new string[4]; answers[0] = "Barak Obama"; answers[1] = "Helmut Kohl"; answers[2] = "Konrad Adenauer"; answers[3] = "Angela Merkel"; Console.WriteLine(quizSingle.question); Console.WriteLine(answers[0]); Console.WriteLine(answers[1]); Console.WriteLine(answers[2]); Console.WriteLine(answers[3]); Console.WriteLine("Bitte wähle die richtige Antwort:"); int answerChoice = int.Parse(Console.ReadLine()); if (answerChoice == 3) { Console.WriteLine("Korrekt"); score++; } else { Console.WriteLine("Falsch"); } Program p = new Program(); p.QuizMenu(score); }