Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ LIST RANDOM NUMBERS Write a program that will insert random integers between 1 and 150 into a list and perform some calculations. You will

c++

image text in transcribed

LIST RANDOM NUMBERS Write a program that will insert random integers between 1 and 150 into a list and perform some calculations. You will prompt the user to ask them the number of elements in your list. You will then get that many random numbers between 1 and 150 anu: list. You will use a function to sort the numbers in your list. screen to print the elements in your list. Now, use an iterator to the Let's work with the list to perform some calculations. Use iterators, algorithms, and list functions (not the user's input variable) to find the sum (iterate through to sum up the elements), mean (average is sum divided by size oflist), median (middle value find the size and use the iterator to move up half way by iterating the iterator half the size times), and range (use algorithms to find the highest and lowest and then take the difference between highest and lowest). Then print the labeled values (with the mean to thre decimal places). Output: List of sorted List numbers on separate lines. The sum, average to three decimal places, median, and range of the numbers in your list Document your program with at least 4 lines of comments at the top and at least 5 comments throughout the code for all of the not easily understandable lines of code. Run your program twice using the following number of elements. Submit your main program and submit the output text file of results. 1st run: 5 numbers 2nd run: 25 numbers

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

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions

Question

Have issues been prioritized?

Answered: 1 week ago

Question

d. How will lack of trust be handled?

Answered: 1 week ago

Question

Are the rules readily available?

Answered: 1 week ago