This commit is contained in:
commit
568474d52f
1591 files changed
+528213
No files matched your search
@@ -0,0 +1,11 @@
|
||||
// A run that stops: dividing by zero inside a function; the lab blames the line and shows the values.
|
||||
// STOPS: divide
|
||||
FUNCTION MEAN(Xs : LIST OF INTEGER) RETURNS FLOAT
|
||||
DECLARE Total : INTEGER
|
||||
Total <- 0
|
||||
FOR EACH X IN Xs
|
||||
Total <- Total + X
|
||||
NEXT X
|
||||
RETURN Total / LENGTH(Xs)
|
||||
ENDFUNCTION
|
||||
OUTPUT MEAN([])
|
||||
Reference in new issue
Block a user