Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program uses methods to: Get the numbers used to calculate the average Get the number of lowest numbers to drop before calculating the average

The program uses methods to: Get the numbers used to calculate the average Get the number of lowest numbers to drop before calculating the average Get the weight, a double greater than 0 and less than or equal to 1 Calculate the weighted average of the numbers (except the lowest n numbers) entered by the user Print the results The first method should take no arguments and return an array list of doubles. The second method should take no arguments and return a single integer, the number of the lowest numbers to drop before calculating the average. The third method should take no arguments and return a double (the weight) The fourth method should take three arguments: an array list of numbers (the return value of the first method above); an integer (the number of smallest items to drop before calculating the average); and a double (the weight). This method should return a double (the weighted average of all the numbers except the lowest n values). The fifth method should take four arguments: an array list of numbers (the return value of the first method above); an integer (the number of smallest numbers to drop before calculating the average); a double (the weight); and a double (the weighted average returned from the fourth method above). This method should have no return value. For example: If the user gives these numbers for calculating the average: 40 60 80 100 20 and the user gives the number 2 to indicate how many of the lowest values should be dropped before calculating the average, and gives a weight of 0.5, then the program should give as output: The weighted average of the numbers is 40.0, when using the data 40.0, 60.0, 80.0, 100.0, 20.0, where 0.5 is the weight used, and the average is computed after dropping the lowest 2 values.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

Students also viewed these Databases questions