Files
pplus-library/pseudo/programs/33-stops-div.pseudo
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

12 lines
330 B
Plaintext

// 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([])