CS60 Homework 6 --------------------------- Due: Mon. Oct 13 at 1:00pm For homework 6, you are asked to design a dynamic integer array. Simply put, your dynamic array must support the following operations: 1.) print the current contents of the array 2.) get an integer value stored at some index of the array 3.) set an integer value at some index of the array 4.) clear the array and free the used memory 5.) grow the array to arbitrary size when somthing attempts to set a value at an index that goes beyond the current size of the array You may implement this dynamic array any way you like, you may want to encapsulate the operations on the array inside functions in case you decide to use your dynamic array in some other program in the future. Turnin -------------------------- The turnin tag for this assignment is 'hw6' and must include the code, a script file showing your dynamic array performing the specified operations, and an optional README file containing any special instructions for the grader. Sample Output --------------------------- [root@localhost root]# gcc darr.c; ./a.out 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 1 --------------------------- Current Array Contents: 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 3 --------------------------- Enter idx and val to add (i,v): 0,32 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 1 --------------------------- Current Array Contents: 32 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 3 --------------------------- Enter idx and val to add (i,v): 1,13 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 1 --------------------------- Current Array Contents: 32 13 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 3 --------------------------- Enter idx and val to add (i,v): 9,54 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 1 --------------------------- Current Array Contents: 32 13 0 0 0 0 0 0 0 54 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 3 --------------------------- Enter idx and val to add (i,v): 7,34 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 1 --------------------------- Current Array Contents: 32 13 0 0 0 0 0 34 0 54 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 2 --------------------------- Enter idx: 0 val=32 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 2 --------------------------- Enter idx: 9 val=54 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 4 --------------------------- 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 1 --------------------------- Current Array Contents: 1 -- print array 2 -- get val from array 3 -- set val in array 4 -- clear array 5 -- exit Enter Menu Option: 5 --------------------------- [root@localhost root]# exit