C++ Programming Challenge 7-9: Driver’s Licence Exam (C++ arrays, C++ loops)

Share it with your friends Like

Thanks! Share it with your friends!


Starting Out With C++ From Control Structures Through Objects

In this exercise we will use C++ arrays heavily and keep track of several arrays at the same time. C++ loops will also be used extensively to populate the array and to get values from the arrays. Demonstrated is also C++ conditional ternary operator.

Driver’s License Office asked you to write a program that grades the written portion of the driver’s license exam.
The exam has 20 multi choice questions. Your app should store the correct answers in an array. It should ask the user to enter the student’s answers for each of the 20 questions and the answers should be stored in another array.
After the answers have been entered, the program should display a message indicating whether the student passed or failed the exam. Student must answer 15 of the 20 questions to pass the exam. It should then display the total number of correctly answered questions, the total number of incorrectly answered questions, and a list showing the question numbers of the incorrectly answered questions.
Input validation: Only accept the letters A, B, C or D as answers.


DOWNLOAD SOURCE FILES: yt-7-9-DriversLicenceExam


Write a comment