public void AnswerQuizBinary(int score) { Quizelement quizBinary = new Quizelement(); quizBinary.question = "Snape ist Harrys Vater."; Console.WriteLine(quizBinary.question); Console.WriteLine("Beantworte die Frage mit J bzw N"); string UserInput = Console.ReadLine(); if (UserInput == "J") { Console.WriteLine("Falsch"); score++; } else { Console.WriteLine("Korrekt"); } Program p = new Program(); p.QuizMenu(score); }
public void AnswerQuizGuess(int score) { Quizelement quizGuess = new Quizelement(); quizGuess.question = "Schätze, wie viele Schüler in Hogwards sind."; Console.WriteLine(quizGuess.question); Console.WriteLine("Gib eine Zahl ein:"); double number = double.Parse(Console.ReadLine()); double toleranceMin = 1 * 2500; double toleranceMax = 1.1 * 2500; 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 = "Harry Potter: Die Kammer des ..."; Console.WriteLine(quizFree.question); Console.WriteLine("Deine Antwort ist: "); string rightWord = Console.ReadLine(); if (rightWord == "Schreckens") { Console.WriteLine("Korrekt"); score++; } else { Console.WriteLine("Falsch"); } Program p = new Program(); p.QuizMenu(score); }
public static void SolveAQuestion(Quizelement quizelement) { Console.Clear(); quizelement.ShowQuestion(); Console.Write("\nYour choice: "); if (quizelement.answers[Int32.Parse(Console.ReadLine()) - 1].isTrue()) { score += 10; Console.Write("\nRight Answer! 10 Points to Gryffindor!"); } else { Console.Write("\nWrong Answer. Sorry for that, bro!"); } currentQuizelement++; }
public void AnswerQuizMultiple(int score) { Quizelement quizMultiple = new Quizelement(); quizMultiple.question = "Wer ist im Haus Gryffindor?"; string[] answers = new string[6]; answers[0] = "Malfoy"; answers[1] = "Ron"; answers[2] = "Hagrid"; answers[3] = "Harry"; answers[4] = "Voldemord"; answers[5] = "Hermine"; 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] == "2" && answer[1] == "3" && answer[2] == "5") { 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 hat Harry im 2. Teil gegen die Kammer des Schreckens geholfen?"; string[] answers = new string[4]; answers[0] = "Dumbledore"; answers[1] = "Snape"; answers[2] = "Dobby"; answers[3] = "George"; 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); }