By Observation ...
All variables are declared
White space is ignored
2 Comment forms
-- to end-of-line
Paired /* */
Assignment is :=
Statements end in ;
Hybrid I/O
Basic data types
New concepts --
config
region
[...] notation
complex operators
program Sample_Stats;
/* Program to compute mu & sigma */
config var n : integer = 100;
region V = [1..n];
procedure Sample_Stats(); -- Entry point
var Sample : [V] float;
mu, sigma: float;
[V]begin
read(Sample);
mu := +<<Sample/n;
sigma:= sqrt(+<<((Sample-mu)^2)/n);
writeln(“Mean: “,mu,”S.D. :”, sigma);
end;
Previous slide
Next slide
Back to first slide
View graphic version