Question: 4 . 7 . 5 : Fix this program so that it only stops reading numbers when the user enters Q . This program reads
: Fix this program so that it only stops reading numbers when the user enters Q
This program reads a sequence of floatingpoint values and computes their average. A value of zero is used as the sentinel Improve the loop so that the loop is only exited if the user enters the letter Q Empty print statements are included for output formatting.
This program reads a sequence of floatingpoint values and computes their average. A value of zero is used as the sentinel
Improve the loop so that the loop is only exited if the user enters the letter Q Empty print statements are included for output
formatting.
total
count
TODO: Fix this program so that it only stops reading numbers
when the user enters Q
value floatinputEnter a real value or Q to quit:
print
while value :
total total value
count count
value floatinputEnter a real value or Q to quit:
print
avg total count
printavg
Only edit line
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
