A_boundary = -11B_boundary = -12C_boundary = -13D_boundary = -145while D_boundary < 0 or D_boundary > 1:6D_boundary = float(raw_input("Enter the minimum percentage required for a 'D' (must be between 0 and 1): "))7if (D_boundary < 0) or D_boundary > 1:8print 'Sorry, the boundary of', D_boundary, "for a grade of 'D' is invalid.",9print "Please try again."1011while C_boundary <= D_boundary or C_boundary > 1:12prompt = "Enter the minimum percentage required for a 'C' (must be between %f and 1): " % D_boundary13C_boundary = float(raw_input(prompt))14if (C_boundary <= D_boundary) or C_boundary > 1:15print 'Sorry, the boundary of', C_boundary, "for a grade of 'C' is invalid.",16print "Please try again."1718while B_boundary <= C_boundary or B_boundary > 1:19prompt = "Enter the minimum percentage required for a 'B' (must be between %f and 1): " % C_boundary20B_boundary = float(raw_input(prompt))21if (B_boundary <= C_boundary) or B_boundary > 1:22print 'Sorry, the boundary of', B_boundary, "for a grade of 'B' is invalid.",23print "Please try again."2425while A_boundary <= B_boundary or A_boundary > 1:26prompt = "Enter the minimum percentage required for an 'A' (must be between %f and 1): " % B_boundary27A_boundary = float(raw_input(prompt))28if (A_boundary <= B_boundary) or A_boundary > 1:29print 'Sorry, the boundary of', A_boundary, "for a grade of 'A' is invalid.",30print "Please try again."3132score1 = -133while score1 < 0 or score1 > 100:34score1 = float(raw_input('Enter the score for exam 1: '))35if score1 < 0 or score1 > 100:36print 'The score must be between 0 and 100. Please re-enter'3738score2 = -139while score2 < 0 or score2 > 100:40score2 = float(raw_input('Enter the score for exam 2: '))41if score2 < 0 or score2 > 100:42print 'The score must be between 0 and 100. Please re-enter'4344score3 = -145while score3 < 0 or score3 > 100:46score3 = float(raw_input('Enter the score for exam 3: '))47if score3 < 0 or score3 > 100:48print 'The score must be between 0 and 100. Please re-enter'4950# Compute the average score and put it into a variable named average_score51average_score = (score1 + score2 + score3) / 352average_score_as_percent = average_score / 1005354if average_score_as_percent >= A_boundary:55grade = 'A'56elif average_score_as_percent >= B_boundary:57grade = 'B'58elif average_score_as_percent >= C_boundary:59grade = 'C'60elif average_score_as_percent >= D_boundary:61grade = 'D'62else:63grade = 'F'6465print "Your average score was", average_score, 'for a grade of', grade6667