High and Low Project
Design amodularprogram which asks the user to enter a list of numbers. The numbers must be stored in an array. The program then finds the index of thefirstoccurrence of the smallest element in the array and thelastoccurrence of the largest element in the array. The program displays the position and value of each of these items.
Rather than processing items as they are read in as we have done so far, this program is asking you to read all the data into memory and then do the processing. Your design should contain a minimum of two functions. The first function takes as input the array and returns the indexof the location of thefirstoccurrence of the smallest item. The second function takes the array as input and returns theindexof the location of thelastoccurrence of the largest item in the array. Your functions do not need to return the highest and lowest data values since having theindexis all that is needed to access the values. Do not display the highest and lowest values inside thefunctions. Use the index returned from the functions to display the values in the main function.
C++
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here