Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions