Question: 1 . Consider the following algorithm. if ( ( average > = 9 0 ) and ( average < 1 0 0 ) ) :
Consider the following algorithm.
if average and average :
printStudent earns an A
elif average and average :
printStudent earns a B
elif average and average :
printStudent earns a C
elif average and average :
printStudent earns a D
else:
printStudent earns an F
Does the condition if average and average NEED to be a compound condition? In other words, could the condition
elif average and average :
be replaced with the condition
elif average :
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
