Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prompt the user to enter an integer between 3 and 20. This will be the number of grades we will average. Use a while loop

Prompt the user to enter an integer between 3 and 20. This will be the number of grades we will average.

Use a while loop to make sure the input is good. I.e., if I enter a letter, float, or integer outside that range, ask me to try again until I enter a good number. Hint: initialize a sentinel value before the loop, and a try and except block inside the loop.)

Use a for loop and the randint function to get the number of integers requested. Print out each one, and it's letter grade. Your letter grade function from the last assignment shouldn't have to be modified here.

Average them. (Hint: You haven't been taught how to create an unknown number of variables, so I don't expect you to create grade1, grade2, etc. Just get a new grade each time through the loop, print it, and add it to a running total. When the loop is done, you should have a total of all of the grades, and simply divide that by the number of grades to get an average.)

Print the average and its letter grade.

Using Python Language

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

Mastering Real Time Analytics In Big Data A Comprehensive Guide For Everyone

Authors: Lennox Mark

1st Edition

B0CPTC9LY9, 979-8869045706

More Books

Students also viewed these Databases questions