Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Ignore requirement 1 and 2 The local Driver's License Office has asked you to write a program that grades the written portion of the driver's
Ignore requirement 1 and 2
The local Driver's License Office has asked you to write a program that grades the written portion of the driver's exam. The exam has 20 multiple choice questions. A data file contains the correct answers as follows: B D A A A B A D B D A D B D A CSCI 201 Computer Science I Spring 21 2 Your program should read above correct answers from the file to 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 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 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 of showing the question numbers of the incorrectly answered questions. Input Validation: only accept the letters of A, B, C or D as answers. Input Answers of 20 questions Output A message to indicate if the student has passed the exam. Number of correct answers. Number of incorrect answers. A list that shows the question numbers of the incorrectly answered questions An Example of Test Run The output of your program might look like this: >a.out Please enter the student's answers for each of the questions. Press Enter after typing each answer. Please enter only an A, B, C, or D for each question. Question 1: B Question 2: D Question 3: A Question 4: A Question 5: A Question 6: B Question 7: B Question 8: A Question 9: C Question 10: D Question 11: B Question 12: B Question 13: D Question 14: A Question 15: D Question 16: D Question 17: A Question 18: B Question 19: D Question 20: A Student passed the exam Correct Answers = 15 Incorrect Answers = 5 The list below shows the question numbers of the incorrectly Requirements 1. Design your algorithm first using a structure chart. Follow Lab 5, 6 and 7 to draw your structure chart 2. Write the program according to the structure chart in step 1. It should include main function and other functions. 3. Insert comments in the program so that it can be read easily. Don't forget to include your name, your startID, section number, file location and a description of the purpose of this program on the top of your program. 4. For each function defined for this program, write necessary documentation. You should also include comments about all parameters using pre- and post-conditions. 5. Pre-condition: the conditions that must exist at the beginning of a function Post-condition: the conditions at the end of a function. Here is an example: /** Calculates the total fees for the year. * Pre: The number of credits to be taken each term: firstTerm, secondTerm and thirdTerm * @Post: Returns the annual fees */ int calculate Fee (int firstTerm, int secondTerm, int thirdTerm) { int fee = termFee (firstTerm) + termFee (secondTerm) + termFee (thirdTerm); return fee; } // end calculate FeeStep 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