home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
PASANS.ZIP
/
CH09_1.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-02-04
|
1KB
|
52 lines
(* Chapter 9 - Programming exercise 1 *)
program Five_friends;
type Person = record
First_Name : string[10];
Last_Name : string[10];
Age : integer;
end;
var Friends : array[1..5] of Person;
Index : integer;
begin
Friends[1].First_Name := 'Donald';
Friends[1].Last_Name := 'Duck';
Friends[1].Age := 50;
Friends[2].First_Name := 'Jack';
Friends[2].Last_Name := 'Frost';
Friends[2].Age := 134;
Friends[3].First_Name := 'Humpty';
Friends[3].Last_Name := 'Dumpty';
Friends[3].Age := 76;
Friends[4].First_Name := 'Howdy';
Friends[4].Last_Name := 'Doody';
Friends[4].Age := 32;
Friends[5].First_Name := 'Blaise';
Friends[5].Last_Name := 'Pascal';
Friends[5].Age := 231;
for index := 1 to 5 do
Writeln(Friends[Index].First_Name,' ',
Friends[Index].Last_Name,' is',
Friends[Index].Age:4,' years old.');
end.
{ Result of execution
Donald Duck is 50 years old.
Jack Frost is 134 years old.
Humpty Dumpty is 76 years old.
Howdy Doody is 32 years old.
Blaise Pascal is 231 years old.
}