June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -0,0 +1,32 @@
import system'math
import extensions.
program =
[
array<real> inputs := real<>(11).
console printLine("Please enter 11 numbers :").
0 till:11 do(:i)
[
inputs[i] := console readLine; toReal.
].
console printLine("Evaluating f(x) = |x|^0.5 + 5x^3 for the given inputs :").
10 to:0 do(:i)
[
var r1 := inputs[i] absolute; sqrt.
var r2 := inputs[i] power(3).
var r :=inputs[i] /*absolute;*/ sqrt + 5*r2.
real result := (inputs[i] absolute; sqrt) + 5 * (inputs[i] power(3)).
console print("f(", inputs[i], ")=").
if (result > 400)
[
console printLine("Overflow!")
];
[
console printLine(result).
]
]
].