232k views
5 votes
BTW this is for python also don't make it complicated make it easy

1. You are beginning to prepare for post-secondary education! You are looking to see if your marks are good enough to get into various schools. You will:
a. Prompt user input for their name and their marks. You will always be in exactly 4 courses and your marks will be integers (i.e. you cannot receive a 90.5% in a course).
b. Prompt the user for a post-secondary school and the average needed to get into that school.
c. If the user enters a mark or average that is not an integer, below 0, or above 100, prompt them again.
d. Calculate the average mark of the user. Round the average to one decimal place.
e. Output the user’s average, their letter grade and whether the user has a high enough average to get into the school they have entered.
Sample Input:
Name = Mr. Slater
Mark 1 = 90
Mark 2 = 90
Mark 3 = 90
Mark 4 = 90
School 1 = Queen’s
Average 1 = 85Sample Output:
Mr. Slater’s average is 90.0%! That is an A.
Mr. Slater has a high enough average for Queen’s!

BTW this is for python also don't make it complicated make it easy 1. You are beginning-example-1
User Narm
by
4.9k points

1 Answer

2 votes

Answer:

name = input('Enter name: ')

grades = [input("Enter Grade #" + str(i+1) + ": ") for i in range(4)]

dream_school = input('Enter school: ')

average = round(sum(grades)/len(grades), 1)

if average < 60:

letter = 'F'

elif average < 70:

letter = 'D'

elif average < 80:

letter = 'C'

elif average < 90:

letter = 'B'

else:

letter = 'A'

print(name + "'s average is " + str(average) + ". That is a " + letter)

if letter == 'A': print(name + "has enough for " + dream_school)

User Roshni Kyada
by
5.2k points