Question
Please code it in python, follow exactly the instructions. You have been hired by a teacher to create a program that will tell the student
Please code it in python, follow exactly the instructions.
You have been hired by a teacher to create a program that will tell the student what their average and letter grade is for a class based on 5 quiz grades.
Instructions:
Use the following algorithm as your guide to create this program.
MUST use a loop also to ask for the 5 quiz grades
MUST store the grades in a list
MUST use the sum and len functions with your list to find the average
Make sure that you use exception handling so that if the user tries to enter a word like ninety instead of a number like 90, for example, it will tell them what they did wrong nicely instead of just crashing.
#Define main function #Create constants to store letter grades A - F associated with their lowest numeric value (like A = 90) #Declare and initialize string variable to store name #Declare and initialize real variables for quiz grade, number of times taking a course, and average #Create a list that will store 5 quiz grades #display an introduction #prompt for users name #prompt the user for the number of times they have attempted this course #using a loop prompt for a quiz grade 5 times adding each grade to your list (use their name in the prompt and display it with a cap 1st letter) #calculate the average of the 5 grades #use a decision to display a letter grade based on the average #if the average is 90 or higher and it is their first attempt at the class display "Your average is ____ You earned an A, GREAT JOB!" #if the average is 90 or higher and it is their second attempt at the class #display "Your average is ____ . You earned an A, aren't you glad you gave it a second try!" #if the average is 90 or higher and it is their third attempt at the class #display "Your average is ____ . You earned an A, Third time is a charm!" #if the average is between 80 and 89 and it is their first attempt at the class display "Your average is ____ . You earned an B, Good Job!" #if the average is between 80 and 89 and it is their second attempt at the class #display "Your average is ____ . You earned an B, aren't you glad you gave it a second try!" #if the average is between 80 and 89 and it is third third attempt at the class #display "Your average is ____ . You earned an B, Third time is a charm!" #if the average is between 70 and 79 and it is their first attempt at the class #display "Your average is ____ . You earned an C, please keep studying to get even better!" #if the average is between 70 and 79 and it is their second attempt at the class #display "Your average is ____ . You earned an C, aren't you glad you gave it a second try!" #if the average is between 70 and 79 and it is their third attempt at the class #display "Your average is ____ . You earned an C, You Pass - Third time is a charm!!" #if the average is between 60 and 69 and it is their first attempt at the course #display "Your average is ____ . You earned an D, it's passing but will not transfer! I would take it again" #if the average is between 60 and 69 and it is their second attempt at the course display #"Your average is ____ . You earned an D, it's passing but will not transfer!, I would take it again but you will have to pay more this time" #if the average is between 60 and 69 and it is their third attempt at the course #display "Your average is ____ . You earned an D, it's passing but will not transfer! I'm afraid you have used all your attempts at this class and cannot re-take it!" #if the average is under 60 it is their first attempt at the course #display "Your average is ____ . You earned an F, Please try this class a second time!" #if the average is under 60 it is their second attempt at the course #display "Your average is ____ . You earned an F, Please try this class a third time, but you will pay more this time!" #if the average is under 60 it is their third attempt at the course #display "Your average is ____ . You earned an F, I'm afraid you have used all your attempts at this class and cannot re-take it!" #display outro (use their name in the outro and display it with a cap 1st letter) thanking them for using the program
Step 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