Question: Problem 4 : Calculating Exam Scores In this problem, you will use a loop to calculate scores for two students who have taking a multiple

Problem 4: Calculating Exam Scores
In this problem, you will use a loop to calculate scores for two students who have taking a multiple-choice exam with 25
questions. Assume that the correct answers on the exam are as follows:
Correct Answers: D, B, C, A, C, D, A, C, C, B, D, A, B, D, C, D, C, D, C, A, B, D, C, B, A
The answers submitted by the two students are provided below.
Student 1 Answers: A, B, C, A, B, D, A, A, C, B, D, A, D, C, C, B, C, D, B, A, D, D, C, C, A
Student 2 Answers: D, A, C, A, B, D, A, C, C, B, D, A, B, D, A, D, C, D, C, A, B, C, C, B, A
Perform the following steps in a single code cell:
1. Create lists of named correct, answers1, and answers2 to store the correct answers for the exam, as well
as the answers submitted by the two students. The answers should be stored as strings of the form 'A','B',
'C', and 'D'.
2. Create variables named count1 and count2 to store the number of correct answers for each student.
3. Use a single loop to simultaneously loop over all three lists. As you do so, count the number of correct answers
for student 1 and student 2.
4. When the loop is finished executing, divide each count of correct answers by the total number of questions and
multiply by 100 to obtain the grades for both students. Store the results as integers in variables named grade1
and grade2.
5. Print the results with descriptive messages as shown below, with the xxxx symbols replaced with the
appropriate values. Match the format and spacing exactly.
Student 1 Grade: xxxx%
Student 2 Grade: xxxx%
No lists should be created for this problem other than the three described in Step 1. Only one loop should be used in
this problem.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!