MODULE graph0; (* DEE 2023-07-21 *) (* From Systematic Programming: An Introduction, pg. 77. *) FROM MathLib0 IMPORT exp, sin; FROM InOut IMPORT Write, WriteLn; CONST d = 0.03125; s = 50; h = 65; c = 6.28318; lim = 128; VAR x, y: REAL; i, n: INTEGER; BEGIN i := 0; REPEAT x := FLOAT(i) * d; y := exp(-x) * sin(c*x); n := TRUNC((FLOAT(s) * y) + 0.5)+h; (* 0.5 to round before truncating. *) REPEAT Write(' '); DEC(n) UNTIL n = 0; Write('*'); WriteLn; INC(i) UNTIL i = lim END graph0.