CSE 9B Winter 97 This is a tentative version. There may be some minor changes. Check this file from time to time for updates. Assignment 6: DUE DATE: DO NOT TURN IN THIS ASSIGNMENT BEFORE THURSDAY Feb 20. Due dates: turnin program Tuesday Feb 25 interview Monday March 3 REQUIRED READING: Savitch text Chapter 10 & 11 PROGRAMMING: This program performs a task like the program in display 9.1 of the Savitch text. it reads in a list of numbers and the outputs the maximum number as well as a list of all the numbers and how much each one differs from the maximum. There is one important difference: THERE IS NO LIMIT TO HOW MANY NUMBERS MAY BE ENTERED. Assume all the numbers are nonnegative and that a sentinel value is used to mark the end of the list. To see how it should work, run the object code hw06.o This is not too difficult but does require that you understand a lot. You will use a two dimensional array and you will use pointers to dynamic arrays. YOU MUST DO IT BY THE METHOD WE OUTLINE BELOW. Your program will start off as follows (possible with other stuff before, after, or mixed in with this:) typedef int* IntPtr; int main( ) { int size = 10; IntPtr score[2];//score[0] and score[1] are (pointers to ) //two dynamic arrays //when we need more room we change from one to the other array. score[0] = new int[size]; int array_copy = 0; score[0] is an array of 10 numbers: score[0][0] score[0][1] score[0][2] ... score[0][9] If the user enters 10 or fewer numbers this array will be used. If the user enters more than 10 numbers, then after reading 10 numbers into the above array, your program will do something equivalent to the following: size = size + 10; score[1] = new int[size]; then copy the contents of score[0] into the first 10 positions of score[1] and then delete the array pointed to by score[1]. Place the numbers from 11th number on in score[1][10], score[1][11] ... Keep going and switching between score[0] and score[1] and back until all the numbers are read. The final dynamic array will be either score[0] or score[1] (depending on how many numbers there are) and will contain ALL the numbers entered (except the sentinel negative value.) Note that it sort of looks like the array is getting bigger, but what really happens is that when one array is full. You create a new larger dynamic array. Copy the old values to the new larger array, delete the old array, and proceed with this new larger array. Hint: This is not really hard and your program will not be that long, but you must think carefully to get through this one. You may get some funny looking square bracket combinations. You do not need a lot of functions on this and if you do a good job with no functions (other than main), you can still get full credit.