Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : SHAPES4.PAS

 
Output of file : SHAPES4.PAS contained in archive : PASTUT.ZIP
(* Chapter 13 - Program 4 *)
program Calculate_Area_Of_Shapes;

uses Areas,Crt,Turbo3;

var In_Char : char;
Length,Width,Height,Base,Radius : real;

begin (* main program *)
repeat
Writeln;
Writeln('Please input the first letter of the selection');
Writeln('Select shape; Square Rectangle Triangle Circle Quit');
Write('Requested shape is ');
Repeat until Keypressed;
Read(Kbd,In_Char);
case UpCase(In_Char) of
'S' : begin
Write('Square Enter length of side ');
Readln(Length);
Writeln('The area is ',Area_Of_Square(Length):12:4);
end;

'R' : begin
Write('Rectangle Enter width ');
Readln(Width);
Write('Enter height ');
Read(Height);
Writeln(' The area is ',
Area_Of_Rectangle(Width,Height):12:4);
end;

'T' : begin
Write('Triangle Enter base ');
Readln(Base);
Write('Enter height ');
Read(Height);
Writeln(' The area is ',
Area_Of_Triangle(Base,Height):12:3);
end;

'C' : begin
Write('Circle Enter radius ');
Readln(Radius);
Writeln('The area is ',Area_Of_Circle(Radius):12:3);
end;

'Q' : Writeln('Quit');
else Writeln(' undefined entry');
end;
until (In_Char = 'Q') or (In_Char = 'q');
end. (* of main program *)




{ Result of execution

(The output depends on the data entered at the keyboard)

}


  3 Responses to “Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : SHAPES4.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/