Write a C++ code which will display the following menu,
1.Read a list of numbers.
3.Save list to File.
4.Load list from file
5.Search for a given number in the list.
7.Calculate the sum of the list.
8.Calculate the average of the list.
9.Find the largest number in the list.
10.Find the smallest number in the list.
Hence the program will read the choice enter
ed from the keyboard and a
statement will proceed according to the choice of the user
. If the
choice is not valid an appropriate message should be displayed.
return back to the main menu after the completion of any selection
and will only be terminated when the Exit Program is selected.
Choices 1 to 10 will call appropriate functions to do the following:
Prompt the proper messages for the user to enter the number of integers to be entered and then the integer numbers should be entered in sequence and stored in an array of integers. . 2.Display the list of integer numbers stored in the array. This option will only be executed if the array is not empty and it has been loaded with numbers either entered from the keyboard or loaded from a file.
3.Save theinteger numbers of the array in a text file.
4.Load the numbers from the file in the array.
5.The user will be prompted to enter an integer number to be searched in the array
and the function will search to find the given number in the array and respond
with a message
hether or not the number is found in the list, how many times
the number is repe
ated in the list and the position(s) where the number is found
in the list.
6.Reverse the order of the list.
7.Calculate the summation of the integer numbers of the list.
8.Calculate the average of the numbers in the list.
This function will use the function created in option 7 above and just divide the result returned from the
function of option 7 with the number of numbers in the list.
9.Find and display the largest number in the list and the position where the number
is located in the list
10.Find and display the smallest number in the list and the position where the
number is located in the list.