Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program pr8_1;
- type
- dayType = record
- day:1..31;
- mounth:1..12;
- year:1..2100;
- end;
- adresType = record
- town:string;
- street:string;
- house:integer;
- end;
- petType = record
- age:1..100;
- name:String;
- count:1..100;
- color:(blue, red, aqua, green, ginger);
- end;
- friend = record
- f_n:string;
- l_n:string;
- age:0..100;
- hobby:string;
- birthday:dayType;
- adres:adresType;
- case havePet:(cat, dog, fish) of
- cat:(haveCat:petType);
- dog:(haveDog:petType);
- fish:(haveFish:petType);
- end;
- var
- student1, student2:friend;
- BEGIN
- with student1 do begin
- f_n:='Valentine';
- l_n:='Nosikov';
- age:=17;
- hobby:='Music, bycycle, readln';
- havePet:=cat;
- with haveCat do begin
- age:=2;
- name:='Anfisa';
- count:=1;
- color:=ginger;
- end;
- with birthday do begin
- day:=14;
- mounth:=2;
- year:=1998;
- end;
- with adres do begin
- town:='Odesa';
- street:='Dobrovolskogo';
- house:=154;
- end;
- end;
- with student2 do begin
- f_n:='Fred';
- l_n:='Mercury';
- age:=45;
- hobby:='Music, bycycle, computer science';
- havePet:=fish;
- with haveFish do begin
- name:='none';
- age:=1;
- count:=11;
- color:=aqua;
- end;
- with birthday do begin
- day:=5;
- mounth:=9;
- year:=1946;
- end;
- with adres do begin
- town:='Zanzibar';
- street:='Stone town';
- house:=1;
- end;
- end;
- with student1 do begin
- writeln('First name: ', f_n);
- writeln('Last name: ', l_n);
- writeln('Age: ', age);
- writeln('Hobby: ', hobby);
- with birthday do begin
- writeln('Birthday: ', day, '.', mounth, '.', year);
- end;
- with adres do begin
- writeln('Town: ', town);
- writeln('Street: ', street);
- writeln('House: ', house);
- end;
- with haveCat do begin
- writeln('Cat name: ', name);
- writeln('Cat age: ', age);
- writeln('Cat color: ', color);
- end;
- end;
- writeln('');
- with student2 do begin
- writeln('First name: ', f_n);
- writeln('Last name: ', l_n);
- writeln('Age: ', age);
- writeln('Hobby: ', hobby);
- with birthday do begin
- writeln('Birthday: ', day, '.', mounth, '.', year);
- end;
- with adres do begin
- writeln('Town: ', town);
- writeln('Street: ', street);
- writeln('House: ', house);
- end;
- with haveFish do begin
- writeln('Fish color: ', color);
- writeln('Fish count: ', count);
- writeln('Fish age: ', age);
- end;
- end;
- read(student1.birthday.day);
- END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement