-- A V Peterson 22-03-2001 -- Lab05 exercise class LAB05 -- The assignment marks for a tutorial group are read in and stored. -- The best mark in the class is reported creation make feature max_tutsize : INTEGER is 20 -- maximum size of a tutorial tutsize : INTEGER -- actual size of a tutorial assign2 : ARRAY[INTEGER] -- assignment 2 marks for students in a tutorial make is local do -- assignment 2 data !!assign2.make(1, max_tutsize) get_assign2_data print_array(assign2) report_best_assign2_mark end -- make print_array(a : ARRAY[INTEGER]) is -- You may use this procedure to print the contents of an -- integer array. For each item in the array, the index and -- the value stored is printed out. To print the contents of -- an array my_array, the procedure call is print_array(my_array) . local i : INTEGER do from i := 1 until i > tutsize loop io.put_integer_format(i, 3) io.put_integer_format(a.item(i), 6) io.put_new_line i := i + 1 end -- loop end -- print_array get_assign2_data is -- read in assign marks and store in assign2 array local i : INTEGER do from i := assign2.lower io.read_integer -- read first integer until -- we have filled the array or run out of data (i > assign2.upper) or io.end_of_input loop assign2.put(io.last_integer, i) io.read_integer -- read next integer i := i + 1 end -- loop tutsize := i - 1 end -- get_tut_data report_best_assign2_mark is -- find and report the best assign2 mark -- [complete this procedure] local do end -- report_best_assign2_mark end -- class LAB05