Question: to be done in c++ CS 162 Programming Lab 2 For this exercise, you will fill an array with random numbers, sort it, and search

to be done in c++

to be done in c++ CS 162 Programming Lab 2 For this

CS 162 Programming Lab 2 For this exercise, you will fill an array with random numbers, sort it, and search it. Program Specification For this program you will get a value from the user between 10 and 20, fill the array with this many random numbers between 1 and 99, sort the array, and then display it. You will then ask the user for 3 numbers and for each value you will say whether it is in the array or not. For this, as in all assignments, you are expected to follow the course programming style guidelines and to properly implement hoth header and source files for your functions. All input should be validated as integer and within range. The minimum functions you are required to implementare: getinteger o min and max value o gets and validates an integer between min and max o returns the value fillArray o pass in the array and count o fills the array with count random numbers between 1 and 99 O no return values sortArray o pass the array and count o sorts the array in ascending order with an insertion sort O no return values display Array o pass the array and count safely o display the array five values per line in neat columns o no return values hin Search o pass the array safely, count, and value to search for o perform a binary search o return true if the value is present, false otherwise Main will define the array,call these functions, and terminate when done. A for loop should be used to get the values to search for and they should be entered with getinteger

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!