Question: 1 . Consider the following algorithm. if ( ( average > = 9 0 ) and ( average < 1 0 0 ) ) :

1. Consider the following algorithm.
if ((average >=90) and (average <100)):
print(Student earns an A)
elif ((average >=80) and (average <90)):
print(Student earns a B)
elif ((average >=70) and (average <80)):
print(Student earns a C)
elif ((average >=60) and (average <80)):
print(Student earns a D)
else:
print(Student earns an F)
Does the condition if ((average >=80) and (average <90)) NEED to be a compound condition? In other words, could the condition
elif ((average >=80) and (average <90)):
be replaced with the condition
elif (average >=80):
and maintain the correctness of the algorithm or is the compound condition required to maintain correctness?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!