Question: please write a C++ class that read random number from .txt file. The program read data from the file and push into an array. Once

please write a C++ class that read random number from .txt file. The program read data from the file and push into an array. Once data is in the array create methods that will output values. PLEASE DONT COPY AND PASTE THE OTHERS PROGRAM FROM CHEGG, PLEASE WRITE YOUR OWN CODE. THANKS

Add the following 11 methods in your program. Explain your all 11 methods. Make sure write a shorter program for memory efficiency (explain also the reason why your program is good in term of memory efficiency)

1. Output all values

2. Output the sum of all values

3. Output all odd numbers

4. Output all even numbers

5. Output Middle Value (Values in the Middle) Not Average

6. Output First Value in the Array

7. Output Last Value in the Array

8. Output the Highest Value and its location in the array. (Hardcode the algorithm.

9. Output the Lowest Value and its location in the array

10. Sort and then output values. Hardcode the bubble sort algorithm you will implement.

11. Create a linear search method that will allow the user to input an integer value and the method will output the location of the value in the array. The value could exist in multiple locations.

The method should output value does not exist if not present in the array.

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!