We can assume the quiz is posted online and that an answer will be selected for each
Question:
We can assume the quiz is posted online and that an answer will be selected for each question. Your program will handle the answers once the quiz has been submitted.
The following are required:
Module main. Call Module input answers. An array with answers will be returned from Module input answers and that should be assigned to a variable exam answers. exam answers is passed to Module grade answers for grading and the display of results.
Module input answers. Uses a loop to prompt an answer 'A'-'D' from the user for each of 20 questions. Each answer should be assigned to an array myAnswers. myAnswers is returned to main() after all answers are entered.
Module grade answers. Uses a loop to compare user answers in exam answers to the correct answers in a parallel array correct answers, initialized to the correct answers. A congratulatory message should be displayed if the number of correct answers is 70% or greater. The number of correct and incorrect answers should be displayed.
Expected Output
Submit your answers to the quiz on the form provided:
Please enter your answer to Question 1.
B
Please enter your answer to Question 2.
D
Please enter your answer to Question 3.
C
Please enter your answer to Question 4.
A
Please enter your answer to Question 5.
B
.
.
.
Please enter your answer to Question 18.
A
Please enter your answer to Question 19.
C
Please enter your answer to Question 20.
D
You passed the exam. Congratulations!
Number of correct answers: 18
Number of incorrect answers: 2
International Economics Theory and Policy
ISBN: 978-0273754206
9th Edition
Authors: Paul R. Krugman, Maurice Obstfeld, Marc J. Melitz