Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program named trivia.cpp that creates the quiz first: Use two parallel arrays: string question [4] and bool answer (4) In a loop, ask
Write a program named trivia.cpp that creates the quiz first: Use two parallel arrays: string question [4] and bool answer (4) In a loop, ask the user to enter 5 questions and their corresponding answers Accept "T", "t", "True", and "true" as Boolean true Accept "F", "E", "False", and "false" as Boolean false o Use an input validation loop to make sure the user enters true or false After the questions are modified, the quiz can be played: In a loop, display the question and ask for a guess Accept "T", "t", "True", and "true" as Boolean true Accept "F","f", "false", and "false" as Boolean false . At the end of the quiz, display how many questions the user guessed correctly Sample Output Let's build a trivia of true or false questions! Please enter Question 1: school buses are YELLON Please enter Answer 1 (T, t, True, true, F, f, False, false): maybe. Invalid input, try again! Please enter Answer i (T, t, True, true, F, f, False, false): Please enter Question 2: WHITEBOARDS ARE YELLOW Please enter Answer 2 (T, t, True, true, e, f, False, false): False Please enter Question 3 : Bananas are yellow Please enter Answer 3 (T, t, True, true, E, F, False, false): true Please enter Question 4: oRaNges Are yellow Please enter Answer 4 (T, t, True, true, E, F, False, false): Let's play the game! Question 1: school buses are YELLOW Please enter a guess (T, t, True, true, F, f, False, false): ta Question 2: WHITEBOARDS ARE YELLOW Please enter a guess (T, t, True, true, F, f, False, false)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started