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

  Create a gantt chart or project plan

Develop in accordance with the systems development life cycle and Create a Gantt chart or project plan (summary and detailed) template.

  Give a cfg for the set of all well formed strings

Give a CFG for the set of all well formed strings over {a,b,+,.,*, ?,?,(,) } that are well formed regular expressions over {a,b}

  Find an equation of the line perpendicular to p1

find an equation of the line perpendicular to p1 and intersecting the line x(t)=t+1,y(t) = 3-t, z(t) = 5t+4 at the point corresping to t=2.

  Explain how is a dsl interconnection distinct from the

q1.what are the basic principles that apply to all networks?q2.what is an ethernet card?q3.what does a network switch

  What is called a whitespace character

Given an int variable modelYear write a statement that assigns true to norecall if the value of modelYear does NOT fall within the two recall ranges and assigns false otherwise. Do not use an if statement in this exercise!

  Write a loop that counts the number of space characters

Write a loop that counts the number of space characters that appear in the String object str.

  Write a mips program that will alter an array of 100 doubles

Write a MIPS program that will alter an array of 100 doubles. No input or output is required. We will assume somebody else did it. Your program modifies the elements in the array as described

  What does the top box, middle box and last box contain

There are three boxes in a Unified Mark-Up Language class diagram. What does the top box, middle box, and last box contain?

  Compute the stress and strain in a steel rod of diameter

In "C", Write a main function and the following to compute the stress and strain in a steel rod of Diameter (D) inches and length (L) subject to the compression loads P of 10,000 to 1,000,000 pounds in increments of 100,000 pounds. The modulus of ..

  What is the paintcomponent method

How does a program intentionally cause the paintComponent method to execute?

  Workplace calls for a lot of planning

Installing Linux on somebody else's machine or in a location that is not your own workplace calls for a lot of planning.

  Show the musical instrument inventory

2. Stefan lano needs displays that will show the musical instrument inventory in his chain of music stores that caters to musicians playing in world-class symphomy orchestras in basel, Switzerland; Buenos aires, argentina; and Philadelphia and..

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