home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 12 - Program 3
- with Text_IO;
- use Text_IO;
-
- procedure Record3 is
-
- type MONTH_NAME is (JAN,FEB,MAR,APR,MAY,JUN,JUL,
- AUG,SEP,OCT,NOV,DEC);
-
- type DATE is
- record
- Month : MONTH_NAME;
- Day : INTEGER range 1..31;
- Year : INTEGER range 1776..2010;
- end record;
-
- type GRADE_ARRAY is array(1..4) of POSITIVE;
-
- type PERSON is
- record
- Name : STRING(1..15);
- Birth_Day : DATE;
- Graduation_Day : DATE := (MAY,27,1987);
- Age : INTEGER := 21;
- Sex : CHARACTER := 'F';
- Grades : GRADE_ARRAY;
- end record;
-
- Self, Mother, Father : PERSON;
-
- begin
-
- Self.Name := "John Q. Doe ";
- Self.Sex := 'M';
- Self.Birth_Day.Month := OCT;
- Self.Birth_Day.Day := 18;
- Self.Birth_Day.Year := 1938;
- Self.Grades(1) := 85;
- Self.Grades(2) := 90;
- Self.Grades(3) := 75;
- Self.Grades(4) := 92;
-
- Mother := Self;
- Father.Birth_Day := Mother.Birth_Day;
- Father.Birth_Day.Day := Self.Birth_Day.Day - 4;
- Mother.Sex := 'F';
-
- end Record3;
-
-
-
-
- -- Result of execution
-
- -- (No output from this program.)
-
-