Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

1.
create a new Java application called "Scorer" (without the quotation marks) that declares a two-dimensional array of doubles (call it scores) with three rows and three columns and that uses methods and loops as follows.
Use a method containing a nested while loop to get the nine (3 x 3) doubles from the user at the command line.
Use a method containing a nested for loop to compute the average of the doubles in each row.
Use a method to output these three row averages to the command line.

2.
First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).
Then create a new Java application called "StringSlicer" (without the quotation marks) that uses methods to:

1. Get a String from the user at the command line

2. Populate an ArrayList of Character data (the wrapper class), with each char in the String represented as a separate Character element in the ArrayList

3. Output each Character to the command line, each on a separate line

3.
create a new Java application called "WeightedAvgDropSmallest" (without the quotation marks) according to the following guidelines.
The program prompts the user for five to ten numbers all on one line, separated by spaces, calculates the weighted average of all those numbers except the lowest n numbers, where n and the weight are also given by the user, and displays all the numbers, the weight, the number of lowest numbers dropped, and the calculated average to the user.

The program uses methods to:

1. Get the numbers used to calculate the average

2. Get the number of lowest numbers to drop before calculating the average

3. Get the weight, a double greater than 0 and less than or equal to 1

4. Calculate the weighted average of the numbers (except the lowest n numbers) entered by the user

5. 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.

Java, Programming

  • Category:- Java
  • Reference No.:- M92775550
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Java

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As