Answered step by step
Verified Expert Solution
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,
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, 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.75Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started