Populate an arraylist of character data

Assignment Help JAVA Programming
Reference no: EM131936894

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.

Verified Expert

The solution file is prepared in netbeans which has three programs are implemented they are scorer to read 3 X3 matrix and calculate average of each row using while and for loop, second program slice the string by character and stored in arraylist as wrapper class character and third program calculate weighted average with drop of lowest number and print results. All above three programs are based on method. Here i have attached three programs and output screen shout for ur reference.

Reference no: EM131936894

Questions Cloud

What is the gain ignoring transactions costs : Assume that a futures contract on Treasury bonds with a face value of $100,000 is purchased at 92-20. If the same contract is later sold at 94-12.
Calls for studying a reaction at low ph values : You are performing an experiment that calls for studying a reaction at low ph values. You need at least three different low ph values
What expected return can imi provide subject : Investment Management Inc. (IMI) uses the capital market line to make asset allocation recommendations.
Write a java application to create and maintain a phone book : Write a Java application to create and maintain a phone book as shown in Figure 9-53. Display appropriate error messages when any action fails.
Populate an arraylist of character data : Populate an ArrayList of Character data (the wrapper class), with each char in the String represented as a separate Character element in the ArrayList
How can a single sequence variant have different effects : Based on what we know about transcription, RNA processing, and translation, how can a single sequence variant have different effects across the transcript
What is the expected return of this investment : What investment has the highest possible expected return while having the samevolatility as Microsoft? What is the expected return of this investment
Discuss terms-liquidity and maturity risk premiums : Assume that the expectations theory holds, and that liquidity and maturity risk premiums are zero. If the annual rate of interest on a 2-year Treasury bond.
Protein and amino acid supplements : Identify two roles that proteins play in the body. What are the benefits and risks of taking protein and amino acid supplements?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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