Write a program that will insert random integers

Assignment Help C/C++ Programming
Reference no: EM13763523

Write a program that will insert random integers between 0 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 0 and 150 and put them in the list. You want to number your random list numbers, so use an iterator to put the list numbers into a map (but keep the list). The key will be the number the random number was generated in starting at 1 (ex. 1, 2, 3, etc., since these are not just index numbers). The value will be the random number. Use an iterator to print the two fields lined up on the right with field widths in two columns with the numbers labeled with centered column headings of Key and Value. Since the list is easier to work with, lets work with the list to perform some calculations. You will sort the numbers in your list. Then use iterators, algorithms, and list functions (not the user's input variable) to find the sum, mean (average), median (middle value - find the size and move up half way), range (difference between highest and lowest), and a random number from a random spot from your list of random number (get a random number (in the proper range) with rand() and move up that many spots in your list). Then print the labeled values (with the mean to three decimal places). Now, use your iterator to put the now sorted list numbers back into the map (which will change the original map's order). The key will still be numbers starting at 1. The value will now be the random number in their sorted order. Again, use an iterator to print the two fields lined up on the right with field widths in two columns with the numbers labeled with column headings of Key and Value. 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 nodes 2nd run: 25 nodes

Reference no: EM13763523

Questions Cloud

Required supplementary information : Question 1: Which of the following items are considered Required Supplementary Information (RSI)?
Hat are risks associated with being independent contractor : What are the risks associated with being an independent contractor? Use the Library or other Web resources to support your answer
Describe a specific tariff and an ad valorem tariff : Describe a specific tariff, an ad valorem tariff, and compound tariff. What are the advantages and disadvantages of each?
How to create a legally binding contract : After reading the U.S. Small Business Administration (SBA) article, "How to Create a Legally Binding Contract," and visiting and reading the Student Career Center's "Advanced Topics for Professional Success" and under the Conflict Management secti..
Write a program that will insert random integers : The value will be the random number. Use an iterator to print the two fields lined up on the right with field widths in two columns with the numbers labeled with centered column headings of Key and Value. Since the list is easier to work with, let..
General public on a user-fee basis : Government units use which fund type to account for services provided to the general public on a user-fee basis?
Officers can perform a stop and frisk in public : The Supreme Court ruled that police officers can perform a "stop and frisk" in public to make reasonable inquiries as to a person's conduct as long as they meet certain criteria
Health care issues : List the strategies you would use to lead the team to success and identify potential obstacles that may be faced, along with plans to deal with them.
Practice in a logical way : How could the organization be roughly positioned in the future.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd