Go to Package Interface

--   CSCI 51, Fall 98, Project 7 --        Compute Numerical Statistics Package
--                                                             File = stats.adb

PACKAGE BODY stats IS

     --  Please document this package

     PROCEDURE sort    (in_array  : IN sort_array;     --  Completed procedure
                        out_array : OUT sort_array;    --  Please document
                        in_count  : IN Natural) IS
          temp : Float;
     BEGIN
          FOR index IN 1..in_count LOOP
               out_array (index) := in_array (index);
          END LOOP;

          FOR j IN 2..in_count LOOP
               FOR index in 2..in_count LOOP
                    IF out_array (index-1) > out_array (index) THEN
                         temp                := out_array (index-1);
                         out_array (index-1) := out_array (index);
                         out_array (index)   := temp;
                    END IF;
               END LOOP;
          END LOOP;
     END sort;

     FUNCTION  average (in_array : IN sort_array;
                        in_count : IN Natural) RETURN Float IS
     BEGIN
          RETURN 0.0;    --  Please write and document this procedure
     END average;

     FUNCTION  median  (in_array : IN sort_array;
                        in_count : IN Natural) RETURN Float IS
     BEGIN
          RETURN 0.0;    --  Please write and document this procedure
     END median;

     FUNCTION  mode    (in_array : IN sort_array;
                        in_count : IN Natural) RETURN Float IS
     BEGIN
          RETURN 0.0;    --  Please write and document this procedure
     END mode;
            
     FUNCTION  max     (in_array : IN sort_array;
                        in_count : IN Natural) RETURN Float IS
     BEGIN
          RETURN 0.0;    --  Please write and document this procedure
     END max;

     FUNCTION  min     (in_array : IN sort_array;
                        in_count : IN Natural) RETURN Float IS
     BEGIN
          RETURN 0.0;    --  Please write and document this procedure
     END min;

END stats;