Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use C++ Please compile & execute code in Command Prompt or Terminal / DO NOT USE IDE Please Include a Snipping Photo of the

Please use C++

Please compile & execute code in Command Prompt or Terminal / DO NOT USE IDE

Please Include a Snipping Photo of the Whiteboard / Pseudo Code of the program below for hardcoded common algorithms

Label using comments the "class" and "object constructors" in your source code.

Make sure to have a deconstructor as part of your class. Label the deconstructor as well.

Implement a class for Task 1 and Hardcode algorithms for Linear Search, Middle Value, First Value, Last Value, Highest Value, Lowest Value, and Bubble Sort.

Main Function: Control of operation

the class called Common_Alg

The class will contain the methods below and an array as the data structure.

The array will be a "Class Variable"

In your Class declare and fill an array with 1000 random integers between 1 - 1000.

Filling the array with random integers should happen in the class constructor.

Please use comments to identify constructors and methods in the program.

1 Output all values

2 Output sum All values

3 Output All odd numbers

4 Output All Even numbers

5 Enter a search value / Implement Linear Search

6 Output Middle Value (Values in the Middle)

7 Not AverageOutput First Value in the Array

8 Output Last Value in the Array

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

10 Output the Lowest Value and its location in the array. (Hardcode the algorithm.)

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions