-- Chapter 23 - Program 2 with Ada.Text_IO, Ada.Integer_Text_IO, Conveyance4; use Ada.Text_IO, Ada.Integer_Text_IO, Conveyance4; procedure Vehicle4 is Hummer : TRANSPORT; Limo : CAR; Chevy : CAR; Dodge : TRUCK; Ford : TRUCK; begin Set_Values(Hummer, 4, 5760.0); Set_Values(Limo, 8); Set_Values(TRANSPORT(Limo), 4, 3750.0); Set_Values(Chevy, 5); Set_Values(TRANSPORT(Chevy), 4, 2560.0); Set_Values(Dodge, 6, 4200.0, 3, 1800.0); Set_Values(Ford, 4, 2800.0, 3, 1100.0); -- Print out the data for the Ford truck just to pick on one -- of the objects for demonstration purposes. Put("The Ford truck has"); Put(Get_Wheels(Ford), 2); Put(" wheels, and can carry"); Put(Get_Passenger_Count(Ford), 2); Put(" passengers."); New_Line; -- Now, let's call the class-wide procedure 5 times. Print_Values(Hummer); Print_Values(Limo); Print_Values(Chevy); Print_Values(Dodge); Print_Values(Ford); end Vehicle4; -- Result of execution -- -- The Ford truck has 4 wheels and can carry 3 passengers. -- This vehicle has 4 wheels, and weighs 5760.0 pounds. -- This vehicle has 4 wheels, and weighs 3750.0 pounds. -- This vehicle has 4 wheels, and weighs 2560.0 pounds. -- This vehicle has 6 wheels, and weighs 4200.0 pounds. -- This vehicle has 4 wheels, and weighs 2800.0 pounds.