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. BE SURE TO INCLUDE THE OUTPUT FROM MULTIPLE PROGRAM RUNS AS A COMMENT BLOCK AT THE BOTTOM OF YOUR SOURCE CODE FILE.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
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:

  1. Get the numbers entered by the user
  2. Calculate the average of the numbers entered by the user
  3. 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.

BE SURE TO INCLUDE THE OUTPUT FROM MULTIPLE PROGRAM RUNS AS A COMMENT BLOCK AT THE BOTTOM OF YOUR SOURCE CODE FILE.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education