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