home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PASTUT34
/
PROC.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-06-03
|
2KB
|
45 lines
program ProcedureDemo;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{ Program to illustrate the use of a procedure with parameters. }
{ The procedure simply creates a Times Table for the entered value of }
{ the multiplicand, or base, for the range of multiplier values also }
{ entered by the user. The procedure is called TimesTable and has the }
{ three parameters: BaseValue, Lower and Upper. }
{ }
{ PROC.PAS -> PROC.EXE R Shaw 13.1.93 }
{______________________________________________________________________}
uses Crt; {The Crt unit contains the procedure to clear the screen.}
var
Base, LowLimit, TopLimit, i : integer;
procedure TimesTable(BaseValue,Lower,Upper: integer);
begin
writeln;
writeln(BaseValue,' Times Table');
writeln;
For i:=Lower to Upper do writeln(BaseValue:2,' * ',i:2,' = ',BaseValue*i:5);
end;
{Main}
begin
ClrScr;
writeln('MULTIPLICATION TABLE FOR SELECTED MULTIPLICAND AND RANGE OF MULTIPLIERS.');
writeln;
writeln('Please enter the data for multiplicand or base value and multipliers.');
writeln('when requested and press the ENTER key after each entry (all < 100).');
writeln;
write('Multiplicand : ');
readln(Base);
write('Lower multiplier: ');
readln(LowLimit);
write('Upper multiplier: ');
readln(TopLimit);
TimesTable(Base,LowLimit,TopLimit);
writeln;
write('Press any key to conclude.');
repeat until keypressed;
end.