Write a java program that revise the meanmedian class

Assignment Help JAVA Programming
Reference no: EM131270275

Write a Java program that meets the following requirements.

1. The mean of a list of numbers is its arithmetic average. The median of a list is its middle value when the values are placed in order. For example, if a list contains 1, 4, 7, 8, and 10, then the mean is 6 and the median is 7. Write an application that allows you to enter five integers and displays the values, their mean, and their median. Save the file as MeanMedian.java

2. Revise the MeanMedian class so that the user can enter any number of values up to 20. If the list has an even number of values, the median is the numeric average of the values in the two middle positions. Save the file as MeanMedian2.java

3. Now, modify the program to throw an exception if an entered value is not an integer. If an exception is thrown, display an appropriate message and allow the user to reenter the value.

Save the file as MeanMedianHandleException.java Ability to:

- Follow established programming conventions for writing java programs
- Create appropriate variables for the data.
- Create an int array.
- Calculate the mean and median of numbers entered.
- Able to correctly use a try...catch block.
- Able to use for loops
- Able to write IF statements.

Reference no: EM131270275

Questions Cloud

How can s-curves provide explanations : How can S-curves provide explanations of why alternative technologies have made substantial inroads against currently dominant technology - How can S-curve theory be used for decision making regarding investment in specific alternative technologies..
State is comprised of mostly rural areas : You are the Director of Public Health for your state.(Any state) Your state is comprised of mostly rural areas. These rural areas do not have access to many state resources, especially in terms of medical care. As a director, it is your job to come u..
Contrast employee development with career development : Contrast employee development with career development. How are they alike? How are they different? Discuss the five traditional career stages. Which of the five is probably least relevant to HRM? Provide rationale for your opinion. Identify the Holla..
Explain why using the characteristics of this market : Perfect Competition Market Structure is the only perfect and efficient market. Explain why using the characteristics of this market.
Write a java program that revise the meanmedian class : Write a Java program that Revise the MeanMedian class so that the user can enter any number of values up to 20. If the list has an even number of values, median is the numeric average of the values in the two middle positions.
Find the marginal productivity of labor : If the company is now using 250 units of labor and 125 units of capital, find the marginal productivity of labor and the marginal productivity of capital.
Mentoring programs for women and minorities : There have been many discussions recently regarding how more women and minorities can break through the glass ceiling. Data suggests these groups are underrepresented in the top echelons of organizations. Several reasons for this have been well docum..
Microeconomic problem and a macroeconomic problem : What is an example of a microeconomic problem and a macroeconomic problem?
Describe resources of architectural engineering design firm : M2A1: Case Analysis: Comprehensive Questions - List, describe, and compare at least 10 constraints lifted and at least 10 constraints imposed on the vehicle when changing from a gasoline engine to an electric-gasoline engine

Reviews

Write a Review

JAVA Programming Questions & Answers

  Finally make a java test class in your test class you must

finally create a java test class. in your test class you should at a minimum a construct 200 instances of each subclass

  Write a method that takes a string as input and returns

Write a method that takes a String as input and returns the reverse of that String. Then write a second method that uses the first method to test whether or not an input String is a palindrome.

  Write a simple tester program

Implement a class named Friend which extends the Contact class. The Friend class should have a field that represents the friend's birthday. For simplicity, the birthdate can be represented with a String.

  Difference between string and stringbuilder

What is the difference between string and StringBuilder? What are the advantages and disadvantages of a StringBuilder

  Calculate the total hours of over lapping meetings

Suppose you have a meeting room which can hold multiple meetings and the smalled duration of meeting can be 30 mins. Calculate the total hours of over lapping meetings.

  Create a java gui app implement inside a main method

Create a Java GUI app, implement the following criteria inside a main method 1) set up a visible frame with width 500, height 300; 2) frame title is "CSE205 Frame app"; and 3) setDefaultCloseOperation to EXIT_ON_CLOSE.

  Represent the relationship between parents - children class

Draw a class diagram that represents the relationship between parents, children, and grandparents. Take into account that a person can have both a parent and a child. Annotate associations with roles and multiplicities.

  Write java statements to create a collection of integers

Write Java statements to create a collection of integers, and to initialize each element of the collection to -1. Then, using for each statement to print the value of each element.

  Give two different ijvm translations for the given java code

Give two different IJVM translations for the following Java statement: i = k + n + 5; Give the Java statement that produced the following IJVM code:

  What is the applet security manager

What is the applet security manager, and what does it provide

  Write a complete java program assuming that the variables gp

Write a complete java program Assuming that the variables gpa, deanList and studentName have been declared, you should read in the studentName and gpa from keyboard. Write an if statement that adds 1 to deansList and prints studentName to the standar..

  Traditionally-nutrition programs were targeted to indigent

Traditionally, nutrition programs were targeted to the indigent and poor populations in developing countries. Many of today's Americans are malnourished also, but they are glutted with a wealth of unhealthy foods and require a multidisciplinary appro..

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