November 13, 2014 · Public
Do this question please..
Q.1: Write a menu-driven program that lets the user perform the operations on an array that can store up to100 integers:
(A) Insert Add a value at the end of the array. If the array already contains 100 elements before performing this operation, display an error message. (B) Insert at Add a value at the offset specified by the user. The offset cannot be larger than the total number of elements in the array at that time. Make sure that the values to the right of the given offset are shifted to the right to make room for the insertion. (C) Remove Remove all instances of a given value from the array. After removing an instance, move all elements to the right of that element one position to the left. (D) Remove at Remove the value written at a specified offset. After removing that element, shift all values to the right of the given offset one position to the left. (E) Sort Ascending Sorts the content of the array in ascending order. (F) Sort Descending Sorts the content of the array in descending order. (G) Swap Swap the contents of the array at the two positions specified by the user. (H) Reverse Reverse the contents of the array (I) Display Min Display the minimum of the contents in the array. (J) Display Max Display the maximum of the contents in the array. (K) Display Std. Deviation Display the standard deviation of the contents in the array accurate to two decimal places. (L) Display Display the contents of the array.
Write functions to perform these operations. If necessary, pass the parameters by reference.