Question: grade and grade2 represent two grades (floats) between 0.0 and 100.0, inclusive. A passing grade is greater than or equal to 50. Select the code


grade and grade2 represent two grades (floats) between 0.0 and 100.0, inclusive. A passing grade is greater than or equal to 50. Select the code fragment(s) that prints the average of the passing grade(s). The printed value should be 0.0 if neither grade is a passing grade, the grade that passes if exactly one grade is a passing grade, and the average of the two grades if both are passing grades. Watch your ifs and elifs! total = 0 grade_count = 0 if gradel >= 50: total = total + grade1 grade_count = grade_count + 1 if grade2 >= 50: total = total + grade2 grade_count = grade_count + 1 if grade_count > 0: return total / grade_count else: return 0.0 O total = 0 grade_count = 0 if gradel >= 50: total = total + gradel grade_count = grade_count + 1 elif grade2 >= 50: total = total + grade2 grade_count = grade_count + 1 if grade_count > 0: return total / grade_count else: return 0.0 O total = 0 grade_count = 0 if gradel >= 50: total = total + gradel grade_count = grade_count + 1 else: total = total + grade2 grade_count = grade_count + 1 if grade_count > 0: return total / grade_count else: return 0.0 total = 0 grade_count = 0 if gradel >= 50 and grade2 >= 50: total = gradel + grade2 grade_count = 2 if grade_count > 0: return total / grade_count else: return 0.0 total = 0 grade_count = 0 if grade1 >= 50: total = total + grade1 grade_count = grade_count + 1 if grade2 >= 50: total = total + grade2 grade_count = grade_count + 1 if grade_count > 0: return total / grade_count else: return 0.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
