Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java language please! Problem #2: (20 pts] Write a Java program that prompts the user to enter N numbers and stores them in an array,

image text in transcribedjava language please!

Problem #2: (20 pts] Write a Java program that prompts the user to enter N numbers and stores them in an array, then finds the average. For example, if the input values are 6, 2.8 and 9.2, then the average is (6 +2.8 +9.2)/3 =6. The program should display the difference between the average and each clement in the array. Sample run 1 : Enter N: 3 Enter the numbers: 6 2.8 9.2 The average is 6.0 6.0 - 6.0 = 0.0 6.0 - 2.8 - 3.2 6.0 9.2 - -3.19999999 Sample run 2: Enter N: 4 Enter the numbers: 1 2 3 7 The average is 3.25 3.25 - 1.0 = 2.25 3.25 2.0 -1.25 3.25 3.0 - 0.25 3.25 7.0 = -3.75

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

How are members held accountable for serving in the assigned roles?

Answered: 1 week ago