Question: Title Data Arrays (Console App) Using C++ The program works with up to 200 int data in an array. Ask the user how many data

Title

Data Arrays (Console App)

Using C++

The program works with up to 200 int data in an array.

Ask the user how many data items is needed, and what the data range is.

* For example 100 numbers between 1000 and 2000.

* The number of data items has to be less than 200 (array size)

Initialize the data with random numbers and print them.

* Use rand() function to create a random number.

* int a = rand()%x; will create a random number between 0 and x.

Sort the data in decreasing order and print it.

* For example [5 7 1 9] with go to [9 7 5 1]

* Sorting involves finding the max and switching its place with the first number

** [5 7 1 9] to [9 7 1 5]

* Then repeat but exclude the first number

** [7 1 5] to [7 1 5] no change

** [1 5] to [5 1]

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!