Question
I need create a program that acts as a grade checker. Here are the instructions below. ************************************** You want to write a program that will
I need create a program that acts as a grade checker. Here are the instructions below.
**************************************
You want to write a program that will take in the number of grades of the students in your class. Since the students in a class vary from semester to semester, there is no fixed number assigned to the number of students. You will keep track of how many students grade you input. You will stop taking input when the student enters a grade of minus 1 (-1). Your program will use loops and will accomplish the following: 1. Read in a numeric grade from a student 2. Convert the numeric grade to a letter grade using the grade policies in your syllabus. 3. Keep a running total of the numeric grades entered. 4. Keep a count of the number of grades entered. 5. Issue a message that comments on the letter grade earned. As an example, you may write You made an F! Obviously you did not study! 6. At the end of the program calculate a class average unless there were NO grades entered. All input to the program will be interactive from the keyboard. The output of the program will include the individual grades converted, the message issued to the student, a class average, and the number of grades entered.
This is what code I have so far. Please help!
def main(): grade1 = int(input('Enter your first grade: ')) determine_grade(grade1) grade2 = int(input('Enter your second grade: ')) determine_grade(grade2) grade3 = int(input('Enter your third grade: ')) determine_grade(grade3) grade4 = int(input('Enter your fourth grade: ')) determine_grade(grade4) grade5 = int(input('Enter your fifth grade: ')) determine_grade(grade5) average = calc_average(grade1, grade2, grade3, grade4, grade5) print (" Average score:" ,average) determine_grade(average) def calc_average(grade1, grade2, grade3, grade4, grade5): average_score = (grade1 + grade2 + grade3 + grade4 + grade5) / (5.0) return average_score def determine_grade(score): if(score < 60): print ("your grade is an F") elif(score >= 60 and score <=69): print ("your grade is a D") elif(score >=70 and score <=79): print ("your grade is a C") elif(score >=80 and score <=89): print ("your grade is a B") elif(score >=90 and score<=100): print ("your grade is an A") else: print ('Error: you have not entered a number between 0 and 100.') return score main()
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