18 lines
441 B
Text
18 lines
441 B
Text
// Rosetta Code problem: https://rosettacode.org/wiki/Soloway%27s_Recurring_Rainfall
|
|
// by Jjuanhdez, 09/2022
|
|
|
|
n = 0
|
|
sum = 0
|
|
|
|
do
|
|
input "Enter integral rainfall (99999 to quit): " i
|
|
if (i < 0) or (i <> int(i)) then
|
|
print "Must be an integer no less than 0, try again."
|
|
elsif i = 99999
|
|
break
|
|
else
|
|
n = n + 1
|
|
sum = sum + i
|
|
print " The current average rainfall is ", sum/n
|
|
end if
|
|
loop
|