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
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