Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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++
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 getintegerStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started