Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

create a new Java application called AverageWithArrays (without the quotation marks) according to the following guidelines. (This program requires the use of arrays.) The program

create a new Java application called "AverageWithArrays" (without the quotation marks) according to the following guidelines. (This program requires the use of arrays.)

The program prompts the user for five to ten doubles, all on one line, each separated by a space, calculates the average of those doubles, and displays the doubles and their average to the user.

The program uses methods to:

Get the doubles entered by the user

Calculate the average of the doubles entered by the user

Print the results

The first method should take no arguments and return an array of doubles that the user entered.

The second method should take an array of doubles (the return value of the first method above) as its only argument and return a double (the average).

The third method should take an array of doubles and a (single) double value as arguments but have no return value.

For example, if the user input is...

40.00 60.00 20.00 80.00 100.00

...the program should give as output... The average of the numbers 40.00, 60.00, 20.00, 80.00, and 100.00 is 60.00.

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_2

Step: 3

blur-text-image_3

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

How can you defend against SQL injection attacks?

Answered: 1 week ago