Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help! Sping 2020 The local Driver's License Office has asked you to write a program that grades the written portion of the driver's license
Please help!
Sping 2020 The local Driver's License Office has asked you to write a program that grades the written portion of the driver's license exam. The exam has 10 multiple choice questions. Here are the correct answers: 1. A inimitviosios 9. C 10.D Your program should store the correct answers shown above in an array. It should ask the user to enter the student's answers for each of the 10 questions, and the answers should be stored in another array. After the student's answers have been entered, the program should display a message indicating whether the student passed or failed the exam. (A student must correctly answer 7 of the 10 questions to pass the exam.) It should then print the question numbers that the user answered incorrectly. Input Validation: Only accept the letters A, B, C, or D as answers. void getStudentAnswers(char *, int); void gradeAnswers(char *, char *, bool *, int); void printResult(bool [], int); int main() char correct_answers[QUESTION_NUM] = { /*initialization*/}; char student_answers(QUESTION_NUM); bool results(QUESTION_NUM); return 0; Sample run #1: Sample run #2: Please enter your answers for the folowing ten questions: Question 1: A Question 2: D Question 3: B Question 4: E E is not a valid answer Please enter a valid answer (A,B,C,D): F F is not a valid answer Please enter a valid answer (A,B,C,D): C Question 5: C Question 6: B Question 7: A Question 8: B Question 9: A Question 10: A Please enter your answers for the folowing ten questions: Question 1: A Question 2: A Question 3: B Question 4: E Question 5: D Question 6: B Question 7: A Question 8: B Question 9: A Question 10: A Sorry! You failed the exam! You missed questions 24 5 9 10 Congratulations! You passed the exam! You missed questions 4 9 10 Sping 2020 The local Driver's License Office has asked you to write a program that grades the written portion of the driver's license exam. The exam has 10 multiple choice questions. Here are the correct answers: 1. A inimitviosios 9. C 10.D Your program should store the correct answers shown above in an array. It should ask the user to enter the student's answers for each of the 10 questions, and the answers should be stored in another array. After the student's answers have been entered, the program should display a message indicating whether the student passed or failed the exam. (A student must correctly answer 7 of the 10 questions to pass the exam.) It should then print the question numbers that the user answered incorrectly. Input Validation: Only accept the letters A, B, C, or D as answers. void getStudentAnswers(char *, int); void gradeAnswers(char *, char *, bool *, int); void printResult(bool [], int); int main() char correct_answers[QUESTION_NUM] = { /*initialization*/}; char student_answers(QUESTION_NUM); bool results(QUESTION_NUM); return 0; Sample run #1: Sample run #2: Please enter your answers for the folowing ten questions: Question 1: A Question 2: D Question 3: B Question 4: E E is not a valid answer Please enter a valid answer (A,B,C,D): F F is not a valid answer Please enter a valid answer (A,B,C,D): C Question 5: C Question 6: B Question 7: A Question 8: B Question 9: A Question 10: A Please enter your answers for the folowing ten questions: Question 1: A Question 2: A Question 3: B Question 4: E Question 5: D Question 6: B Question 7: A Question 8: B Question 9: A Question 10: A Sorry! You failed the exam! You missed questions 24 5 9 10 Congratulations! You passed the exam! You missed questions 4 9 10Step 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