Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that contains two overloaded methods that return the average of an array with the following headers: public static int average(int[] array) public

Write a program that contains two overloaded methods that return the average of an array with the following headers:

public static int average(int[] array)

public static double average(double[] array)

Write a program that prompts the user to enter ten integer values into an array named list1, invokes the appropriate method and displays the average value. The program then prompts the user to enter ten double values into an array named list2, invokes the appropriate method and displays the average value.

image text in transcribed

EC-lwindowslsystem321cmd.exe Average arrays Enter 10 integer values: 2 45 1 2 6 8 4 5 9 The average of the ten integers is 4 Enter 10 double values 2.5 1.2 4.5 8.1 2.3 7.5 7.5 8.4 6.9 9.5 Press any key to continue - The average of the ten doubles is 5.839999999999999 EC-lwindowslsystem321cmd.exe Average arrays Enter 10 integer values: 2 45 1 2 6 8 4 5 9 The average of the ten integers is 4 Enter 10 double values 2.5 1.2 4.5 8.1 2.3 7.5 7.5 8.4 6.9 9.5 Press any key to continue - The average of the ten doubles is 5.839999999999999

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

Step: 3

blur-text-image

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

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions

Question

=+Trainers from headquarters? Local trainers? Independent trainers?

Answered: 1 week ago