0% found this document useful (0 votes)
3 views3 pages

For..do Loop

The document outlines three programming tasks involving loops in a Delphi application. The first task displays the next 10 numbers after an input, the second displays numbers from 1 to the inputted number, and the third outputs a message every time a dozen numbers are displayed from 1 to 180. Each task includes sample code demonstrating the implementation of the described functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

For..do Loop

The document outlines three programming tasks involving loops in a Delphi application. The first task displays the next 10 numbers after an input, the second displays numbers from 1 to the inputted number, and the third outputs a message every time a dozen numbers are displayed from 1 to 180. Each task includes sample code demonstrating the implementation of the described functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

For..

Do Loop

Statement of the Problem:

1. Create an application that will display the next 10 numbers when a

number is inputted.

Output:

Code:

procedure TForm1.Button1Click(Sender: TObject);


var ctr:integer;
x:real;

begin
x:=strtofloat([Link]);
[Link];
for ctr:=1 to 10 do
[Link](floattostr(x+ctr));
end;
end.
Statement of the Problem:

2. Create a program that will display starting from 1 up to the inputted

number.

Output:

Code:

procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;


Shift: TShiftState);
[Link](num);
var x,ctr:integer; end;
num:string; end;
end;
begin end.
if key=VK_return then
begin
x:=strtoint([Link]);
[Link];
num:='';
for ctr:=1 to x do
begin
num:=num+inttostr(ctr);
Statement of the Problem:

3. Create an application 1 up to 180 that will display the word “A dozen

has passed every time a dozen of numbers will pass.

Output:

Code:

procedure TForm1.Button1Click(Sender: TObject);


var ctr,m,x:integer;

begin if m=0 then


[Link]; [Link]('A dozen has
for ctr:=1 to 80 do passed');
begin end;
[Link](inttostr(ctr)); end;
m:=ctr mod 12; end.

You might also like