Soloway's recurring rainfall: Difference between revisions
→{{header|Wren}}: Changed to allow for negative rainfall which is news to me!
No edit summary |
(→{{header|Wren}}: Changed to allow for negative rainfall which is news to me!) |
||
Line 676:
var sum = 0
while (true) {
var i = Input.integer("Enter integral rainfall (99999 to quit): "
if (i == 99999) break
n = n + 1
Line 687:
<pre>
Enter integral rainfall (99999 to quit): 5.4
Must be an integer
Enter integral rainfall (99999 to quit):
Must be an integer
Enter integral rainfall (99999 to quit): 5
The current average rainfall is 5
Enter integral rainfall (99999 to quit): -2
The current average rainfall is
Enter integral rainfall (99999 to quit): 4
The current average rainfall is 2.3333333333333
Enter integral rainfall (99999 to quit): 10
The current average rainfall is
Enter integral rainfall (99999 to quit): 99999
</pre>
|