Question: Please write all code in C++ Programming Assignment: We have learned about arrays in class. Now we want to sort an array and search for
Please write all code in C++
Programming Assignment: We have learned about arrays in class. Now we want to sort an array and search for a value in the array Objectives: Accessing arrays I/O redirection Writing user defined functions Using and debugging other's code . Using library functions Specification: Modify a program that reads values (integers) from standard input and stores them in an array, sorts the array using the library sort algorithm), and searches for a requested value in the array After reading the array, the array shall be printed out using the supplied function printAsray The Integer, 234, shall be added to the array after the final integer that was initially read using the supplied function, . Sort the array using the library function from the 'algorithm' library . Print out the sorted array using the supplied function printAsray Create a function to search the array for a supplied integer and report on how many times the integer is in the array Requirements: Your code should: Use functions whenever possible Use 'constants' when warranted Be sure your array is sufficiently large to store a set of positive integers (you can assume the maximum array size can store no more than 1000 elements) . Pass the number, "234' to the function to find a number in the array. This function should return the number of times '234' (was found in the array) to the caller. This is the only purpose for this function You need to modify the printAccay function The print function, printAcav has 1 or more 'bugs'. You will have to debug the print function to work. Use the comments of the print function and your understanding of arrays & loops to get the function to work as expected. Please note, the function com:ments.could be incorrect too, so don't rely on them as the truth. To get full credit for debugging the print function, you have to modify the comments accordingly per the 'correct' &'accurate' code The values in the array are not currently printed out in a nice format. You must modify the printAray function to create an appealing output (again see the sample output for what is required The printArray function can be downloaded from the project assignment in Blackboard
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
