Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you check my code? def main(): #gets grade 1 grade1 = int(input('Enter your first grade: ')) # determines the grade determine_grade(grade1) #gets grade 2

Can you check my code?

def main():

#gets grade 1

grade1 = int(input('Enter your first grade: '))

# determines the grade

determine_grade(grade1)

#gets grade 2

grade2 = int(input('Enter your second grade: '))

# determines the grade

determine_grade(grade2)

#gets grade 3

grade3 = int(input('Enter your third grade: '))

# determines the grade

determine_grade(grade3)

#gets grade 4

grade4 = int(input('Enter your fourth grade: '))

# determines the grade

determine_grade(grade4)

#gets grade 5

grade5 = int(input('Enter your fifth grade: '))

# determines the grade

determine_grade(grade5)

#calculates average score

average = calc_average(grade1, grade2, grade3, grade4, grade5)

#displays overall average score and grade

print (" Average score and results")

#displays score

print ("score :") ,average

#determine grade

determine_grade(average)

#function to calculate average of the given marks

def calc_average(grade1, grade2, grade3, grade4, grade5):

average_score = (grade1 + grade2 + grade3 + grade4 + grade5) / (5.0)

return average_score

#function to determine the grade based on the 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

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

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago