For HW6, use the following as a starting point: This is the sample non generic sort package and corresponding test procedure that is to be converted to a generic package and corresponding test procedure that instantiates the generic package and run the built in test data. -- NON_GENERIC_SORT_PACKAGE.ADA package NON_GENERIC_SORT_PACKAGE is type INT_ARRAY is array ( INTEGER range <> ) of INTEGER ; -- the type statement above will move into the generic formal part procedure NNSORT ( ARR1 : in out INT_ARRAY ) ; end NON_GENERIC_SORT_PACKAGE ; package body NON_GENERIC_SORT_PACKAGE is procedure NNSORT ( ARR1 : in out INT_ARRAY ) is TEMP : INTEGER ; begin for I in ARR1'FIRST .. ARR1'LAST - 1 loop for J in I + 1 .. ARR1'LAST loop -- This is the classic compare and -- interchange at the heart of all sorts if ARR1 ( I ) > ARR1 ( J ) then TEMP := ARR1 ( I ) ; ARR1 ( I ) := ARR1 ( J ) ; ARR1 ( J ) := TEMP ; end if ; -- end of compare and interchange end loop ; end loop ; end NNSORT ; end NON_GENERIC_SORT_PACKAGE ; -- NON_GENERIC_SORT_DEMO.ADA with NON_GENERIC_SORT_PACKAGE ; use NON_GENERIC_SORT_PACKAGE ; --with GENERIC_SORT_PACKAGE ; -- NO use statement on generic packages ! with TEXT_IO ; use TEXT_IO ; with INT_IO ; use INT_IO ; procedure NON_GENERIC_SORT_DEMO is DATA : INT_ARRAY ( - 3 .. 4 ) := ( 6 , 7 , 3 , 4 , 8 , 1 , 2 , 5 ) ; -- *** INSTANTIATE YOUR GENERIC_SORT_PACKAGE HERE begin NNSORT ( DATA ) ; PUT_LINE ( " SORTED DATA " ) ; for I in DATA'RANGE loop PUT ( DATA( I )) ; NEW_LINE ; end loop ; end NON_GENERIC_SORT_DEMO ; Use gnatchop if compiling with gnat. Compile and execute then run NON_GENERIC_SORT_DEMO to get output SORTED DATA 1 2 3 4 5 6 7 8 The extra credit, a main test procedure should be something like this : This is very difficult. -- EXTRA_SORT.ADA with GENERIC_SORT_PACKAGE ; -- the package you write with TEXT_IO ; package EXTRA_SORT is type ALL_COLOR is ( BLACK, BROWN, RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE, GREY, WHITE ) ; type MY_COLOR is ( RED, ORANGE, YELLOW, GREEN, BLUE, VIOLET ) ; type COLOR_ARRAY is array ( ALL_COLOR range <> ) of MY_COLOR ; MY_ARRAY : COLOR_ARRAY ( ORANGE..BLUE ) := ( VIOLET, RED, YELLOW, BLUE ) ; package MY_SORT is new GENERIC_SORT_PACKAGE ( MY_COLOR , ALL_COLOR, COLOR_ARRAY ) ; package ENUM_IO is new TEXT_IO.ENUMERATION_IO ( MY_COLOR ) ; begin MY_SORT.NNSORT ( MY_ARRAY ) ; -- result of instantiation for I in MY_ARRAY'RANGE loop ENUM_IO.PUT ( MY_ARRAY ( I ) ) ; end loop ; TEXT_IO.NEW_LINE ; end EXTRA_SORT ;