The George Washington University
School of Engineering and Applied Science
Department of Computer Science

CSci 51 -- Introduction to Computing -- Spring 2000
Lab #11
For labs meeting March April 6-7, 2000


Write and test each of the following subprograms:

FUNCTION Mean (Sum: IN Float; N: Integer) RETURN Float;
-- Pre:  Sum and N are defined
-- Post: returns Sum divided by N

PROCEDURE SumAndProduct
   (Left: IN Float; Right: IN Float; Sum: OUT Float; Product: OUT Float);
-- Pre:  Left and Right are defined (have non-garbage values)
-- Post: Sum contains the sum of Left and Right; Product contains their product

PROCEDURE Split (OneTime: IN Ada.Calendar.Time;
                 M: OUT Ada.Calendar.Month_Number;
                 D: OUT Ada.Calendar.Year_Number;
                 Y: OUT Ada.Calendar.Year_Number);
-- Pre:  OneTime is defined
-- Post: M, D, and Y contain the month, day, and year parts of OneTime

PROCEDURE Sort3 (X: IN OUT Float; Y: IN OUT Float; Z: IN OUT Float);
-- Pre:  X, Y, and Z are defined
-- Post: X holds the smallest; Y holds the middle value; Z holds the largest