Question
Can I please get some assistance with this! please? The local Drivers License Office has asked you to write a program that grades the written
Can I please get some assistance with this! please?
The local Drivers License Office has asked you to write a program that grades the written portion of the drivers license exam. The exam has 10 multiple-choice questions. Here are the correct answers:
1. A
2. D
3. B
4. B
5. C
6. B
7. A
8. B
9. C
10. D
Your program should store the correct answers shown above in an array. It should ask the user to enter the students answers for each of the 10 questions, and the answers should be stored in another array. After the students 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.
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 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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