-- Chapter 20 - Programming exercise 3 with Ada.Text_IO, Ada.Integer_Text_IO; use Ada.Text_IO, Ada.Integer_Text_IO; procedure CH20_3 is type THREE_INTS is record Length, Height, Width : INTEGER; end record; Big, Medium, Sum : THREE_INTS; Grand_Total : INTEGER; function "+"(Record1, Record2 : THREE_INTS) return THREE_INTS is Temp : THREE_INTS; begin Temp.Length := Record1.Length + Record2.Length; Temp.Height := Record1.Height + Record2.Height; Temp.Width := Record1.Width + Record2.Width; return Temp; end "+"; function "+"(Record1, Record2 : THREE_INTS) return INTEGER is Total : INTEGER; begin Total := Record1.Length + Record2.Length + Record1.Height + Record2.Height + Record1.Width + Record2.Width; return Total; end "+"; begin Big.Length := 10 + 2; Big.Height := 22; Big.Width := 17; Medium.Length := 5; Medium.Height := 7; Medium.Width := 4; Sum := Big + Medium; Put("The sum is"); Put(Sum.Length, 5); Put(Sum.Height, 5); Put(Sum.Width, 5); New_Line; Grand_Total := Big + Medium; Put("The grand total is "); Put(Grand_Total, 5); New_Line; end CH20_3; -- Result of Execution -- The sum is 17 29 21 -- The grand total is 67