Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!