Question
In c++ please!!!!!!!! Using arrays Write a program that will do the following: Generate 20 random integers with a range of 1 to 10 and
In c++ please!!!!!!!! Using arrays
Write a program that will do the following:
Generate 20 random integers with a range of 1 to 10 and place them into an array of size 20. Re-cycle the functions from Lab 10 where appropriate.
Make this a function.
Send the function the array.
Send the function the size of the array.
The data type of the function will be void since the array will be sent back through the parameter list.
Bring in the function that generates and returns a random number that you created from the previous module. Call that function from this one.
Display the contents of the array. Re-cycle the functions from Lab 10 where appropriate.
Make this a function.
Send the function the array.
Send the function the size of the array.
The data type of the function will be void since nothing will be sent back.
After generating 20 random numbers between 1 and 10, generate one more random number (also from 1 to 10).
Search though the Array and count how many times the extra random number occurs. It is possible that the extra random number may occur more than once or not at all.
Output:
Display the entire array.
Display the extra random number.
Depending upon the result of your search, display one of the following:
How many times the random number occurs.
That the random number did not occur at all.
Also include:
Use a sentinel driven outer While Loop to repeat the task
Ask the User if they wish to generate a new set of random numbers
Clear the previous list of numbers from the output screen before displaying the new set.
Also write a program that adds the following to Lab 11:
Add a function that will use the BubbleSort to put the numbers in ascending order.
Send the function the array.
Send the function the size of the array.
The sorted array will be sent back through the parameter list, so the data type of the function will be void.
Output:
Display the array after the numbers have been placed in it. It will be unsorted at this point.
Display the array after it has been sorted.
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