Question: C++ Get a value from the user between 10 and 20, fill the array with this many random numbers between 1 and 99, sort the

C++ 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. Properly implement both header and source files for your functions. All input should be validated as integer and within range. The minimum functions you are required to implement are

getInteger

min and max value

get and validate an integer between min and max

return the value

fillArray

pass in the array and count

fills the array with count random numbers between 1 and 99

no return values

SortArray

pass the array and count

sorts the array in ascending order with an insertion sort

no return values

DisplayArray

pass the array and count safely

display the array five values per line in neat columns

no return values

BinSearch

pass the array safely, count, and value to search for

perform a binary search

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!