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 "AverageWithMethods" (without the quotation marks) according to the following guidelines.The program prompts the user for five to ten numbers, all on one line, and separated by spaces. Then the user calculates the average of those numbers, and displays the numbers and their average to the user.The program uses methods to:Get the numbers entered by the userCalculate the average of the numbers entered by the userPrint the results with the whole number, a decimal, and two decimal positionsThe first method should take no arguments and return a String of numbers separated by spaces. [CASE 2]The second method should take a String as its only argument and return a double (the average). [CASE 4] The third method should take a String and a double as arguments but have no return value. [CASE 3]For example, if the user input is... 20 40 60 80 100...the program should give as output... The average of the numbers 20 40 60 80 100 is 60.00.

Question

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 "AverageWithMethods" (without the quotation marks) according to the following guidelines.
The program prompts the user for five to ten numbers, all on one line, and separated by spaces. Then the user calculates the average of those numbers, and displays the numbers and their average to the user.
The program uses methods to:
Get the numbers entered by the user
Calculate the average of the numbers entered by the user
Print the results with the whole number, a decimal, and two decimal positions
The first method should take no arguments and return a String of numbers separated by spaces. [CASE 2]
The second method should take a String as its only argument and return a double (the average). [CASE 4]
The third method should take a String and a double as arguments but have no return value. [CASE 3]
For example, if the user input is... 20 40 60 80 100
...the program should give as output... The average of the numbers 20 40 60 80 100 is 60.00.

Expert Answer

Want to see the step-by-step answer?

See Answer

Check out a sample Q&A here.

Want to see this answer and more?

Step-by-step answers are written by subject experts who are available 24/7. Questions are typically answered in as fast as 30 minutes.*

See Answer
*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: Which of the following diagrams do not contradict the current state of our knowledge about the compl...

A: P class problems can be solved in deterministic polynomial time. NP class can be verified in the pol...

Q: Please Use JAVA to solve the problem

A: Create a java class “ArrayInv” and create a main method inside it.And declare a required variable to...

Q: PLEASE EXPLAIN ALL STEPSCreate a truth table of the equation:((((Y AND (NOT Z)) OR ((NOT Y) AND Z)) ...

A: Note: In the given equation, the number of opening and closing brackets is not equal. The following ...

Q: a. Show that the disk moves made in the classic recursive algorithm for the Towers of Hanoi puzzle c...

A: a.Disk moves for Tower of Hanoi puzzle The disk moves that are made in the classic recursive algorit...

Q: Exercise 3.2.1: Here is a transition table for a DFA 0 1 92 qз *q3 q3 a) Give all the regular expres...

A: Since you have posted multiple questions and have not specified which question needs to be solved, w...

Q: Given a nested list named table, use a loop to print each sub list of the nested list. The sub lists...

A: Program descriptionOne 3 x3 list is created to demonstrate the conceptdisplay the elements of the su...

Q: What role does database technology play in managing data as a business resource within an organizati...

A: Data resource management is applying software tools and information systems technologies such as dat...

Q: Python 3.7.4 Assume that print_todays_date is a function that uses no parameters and returns no valu...

A: A statement that calls (invokes) the function print_todays_date is: print_todays_date()This function...

Q: Arrays Write three statements to print the first three elements of array runTimes. Follow each state...

A: Note: As the user given index value is constant and so the value of index will not be changed while ...