BEST代写-线上编程学术专家

Best代写-最专业靠谱代写IT | CS | 留学生作业 | 编程代写Java | Python |C/C++ | PHP | Matlab | Assignment Project Homework代写

C++编程代写 | List Random Numbers

C++编程代写 | List Random Numbers

本次代写主要为C++编程相关的assignment

 

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 and put them in the list.

You will use a function to sort the numbers in your list.  Now, use an output stream iterator to the screen to print the elements in your list.

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 of list), 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 three 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

bestdaixie

评论已关闭。