Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions

Question

What are three disadvantages of using the direct write-off method?

Answered: 1 week ago