Use functions to get a list of integers from a user

Assignment Help Basic Computer Science
Reference no: EM13700357

Use functions to get a list of integers from a user and then find statistics of the given list of integers. You are not allowed to use any built in functions for finding the calculations in this assignment.

The functions required for this assignment will be:

printMenu()-Prints a menu of options to the screen
getList()-Gets list of integers from user using a while loop and returns the list
getMean(userList)-Returns the average of the integers contained in the list given by the user
getMedian(userList)-Returns the median of the integers contained in the list given by the user
printGraph(userList)-Prints a horizontal histogram of the elements in the list
getMin(userList)-Finds the lowest value in the set using a for loop and then prints value to screen
getMax(userList)-Returns the highest value in the set using a for loop
Example output:

Welcome to the List Statistics Calculator
To begin, enter a list of integers or to end the list!
Enter an integer: 67
Enter an integer: 100
Enter an integer: 50
Enter an integer: 100
Enter an integer: 50
Enter an integer: 50
Enter an integer: 60
Enter an integer: q
Please choose the statistic that you would like to calculate!
1. Mean
2. Median
3. Min
4. Max
5. Graph
Please enter your choice, or 0 to exit: 1
The mean of this data set is 68.142
Please choose the statistic that you would like to calculate!
1. Mean
2. Median
3. Min
4. Max
5. Graph
Please enter your choice, or 0 to exit: 2
The median of this data set is 60
Please choose the statistic that you would like to calculate!
1. Mean
2. Median
3. Min
4. Max
5. Graph
Please enter your choice to exit:3
The max of this data set is 100
Please choose the statistic that you would like to calculate!
1. Mean
2. Median
3. Min
4. Max
5. Graph
Please enter your choice, or 0 to exit: 4
The min of this data set is 50
Please choose the statistic that you would like to calculate!
1. Mean
2. Median
3. Min
4. Max
5. Graph
Please enter your choice to exit: 5
50: X X X
60: X
67: X
100: X X
Please enter your choice to exit: 0

Reference no: EM13700357

Questions Cloud

The oracle corporation is an multinational computer : Discuss at lease 500 words. The Oracle Corporation is an multinational computer technology corporation that specializes in developing and marketing hardware systems and enterprise software products.
What is the change in the width of the central maximum : In a large vacuum chamber, monochromatic laser light passes through a narrow slit in a thin aluminum plate and forms a diffraction pattern on a screen that is 0.620m from the slit. What is the change in the width of the central maximum
Find the initial speed of the second stone : A rock climber stands on top of a 60 m high cliff hanger a pool of water. He throws two stones vertically downward 1.0 s apart and observes that they cause a single splash. What was the initial speed of the second stone
Experience with pcap : The purpose of this assignment is to identify your experience with full packet capture.Research packet capture, and report on its usefulness in cyber security and network forensics.
Use functions to get a list of integers from a user : Use functions to get a list of integers from a user and then find statistics of the given list of integers. You are not allowed to use any built in functions for finding the calculations in this assignment.
What is the final pressure of the gas : Expand 1.025 mole of an ideal monatomic gas initially at 5.47 kPa and 642 K from initial volume Vi = 1.00 m3 to final volume Vf = 2.00 m3. What is the final pressure of the gas
Estimate the voltage across the resistor : A current of 2.00 A flows through a resistor that has R = 4.84 ohm. What is the voltage across the resistor
Spanning forest is a subset of a graph : a) Assume Ce in Z. Give an algorithm that finds the MSF (minimum spanning forest), show correctness and running time of this algorithm.
Find the entropy change of the aluminum : In an experiment, 230 g of aluminum (with a specific heat of 900 J/kg • K) at 100°C is mixed with 48.0 g of water (4186 J/kg•K) at 20°C, What is the entropy change of the aluminum

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Explaining topic important for network administrators

Why is the topic important for network administrators today?

  Differentiating unix and window traceroute

Compare and contrast differences between Unix (or Linux) and Window Traceroute. All codes for each ICMP error message are not completely listed and explained.

  Write piece of code uses a loop to compute and precending

The Fibonacci numbers are a sequence of integers in which the first two elements are 1, and each following element is the sum of the two preceding elements

  Discuss the advantages and disadvantages of outsourcing it

Discuss the advantages and disadvantages of outsourcing IT.

  How the organisation has used is-it to address

how the organisation has used IS/IT to address and service its' market, not just on the products it provides.

  Modern computer architecture standards

The X25 demodulator machine has been upgraded to modern computer architecture standards.

  Map elements can placed anywhere within body the web page

Map elements can be placed anywhere within the body of the Web page because they are not actually displayed by the browser, but used as references for mapping ____ to inline images.

  What is the goal of information systems planning?

What is the goal of information systems planning? What are the steps of the traditional systems development life cycle? What is prototyping? What is an RFP? What is typically included in one? How is it used?

  Framing rules work if stuffing rule to stuff zero changes

Will framing rules work if we change stuffing rule to stuff a zero only after 6 consecutive ones? Describe. Will protocol work if we change stuffing rule to stuff 0 only after a zero followed by 5 consecutive ones? Describe.

  Add the following numbers in two''s complements

Given four bits, add the following numbers in two's complements. a. - 4 + (- 1), b. -7 + 3, c. -5 + 4

  The specification for the lexical structure

Writing the lexical analyzer with lexical error checking, and the compilation listing generator for the compiler - The specification for the lexical structure of the language is the following: Comments begin with -- and end with the end of the line..

  Network security & how do they work together

1. In reference to firewalls, proxies, Intrusion Prevention Systems and Intrusion Detection Systems. Why are they important for network security & how do they work together?

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