Monday, April 6, 2020

CONSTRU2.P

[Table of Contents]
Disk Image

CONSTRU2.P is from the Entering  Formulas section of the Kyan Pascal 2.x manual/tutorial. It is a copy of CONSTRU1.P with modifications to send output to the printer.

To see output to the printer in Altirra 3.20, first add a printer by selecting System > Configure System... > Peripherals > Devices > Add > High-level emulation (HLE) devices > Printer (P:), then before running the program, display the printer output window by selecting View > Printer Output.

What's on the disk?


The disk image includes the various Atari DOS 2.5 files, Kyan Pascal Include files (none of which are used in this program), Kyan Pascal Run-time library, and ...

CONSTRU2.P - Source code file
P.OUT - Kyan Pascal intermediate file
CONSTRU2 - Executable file

Source Code


(* CONSTRU2.P *)
(* Kyan Pascal 2.04 / Atari 8-bit *)

Program Constru2(Input, Output);
(* Dollar units are thousands *)

Const
   Material = 325.00;

Var
   Hours, Rate, Labor, Total : Real;
   Printer : Text;

Begin
   Rewrite(Printer,'P:');
   Write(Chr(125)); (* Clear screen *)
   Writeln('Enter hours worked, and press RETURN');
   Writeln('Then enter Rate Of Pay and press RETURN');
   Readln(Hours);
   Readln(Rate);
   Labor := Hours * Rate;
   Total := Labor + Material;
   Writeln(Printer, 'Labor=$', Labor:8:2, ' Total = $', Total:8:2)

End.

Sample Run



No comments:

Post a Comment