Create an array that will hold 6 doubles. Assign a unique value to each spot in the array, one by one. You can put these values directly in your code yourself. No scanner needed. Use a loop to loop through the array and print each value stored in the array. Also, sum all of the values together in this loop. Finally, print out the final sum.   Example Output:   The values stored in your array are: 3.1, 5.2, 8.3, 2.4, 9.5, 10.6 The sum of these values is: 39.1 The square root of 39.1 is: 6.25   in java

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question
  1. Create an array that will hold 6 doubles.

  2. Assign a unique value to each spot in the array, one by one. You can put these values directly in your code yourself. No scanner needed.

  3. Use a loop to loop through the array and print each value stored in the array. Also, sum all of the values together in this loop.

  4. Finally, print out the final sum.

 

Example Output:

 

The values stored in your array are:

3.1, 5.2, 8.3, 2.4, 9.5, 10.6

The sum of these values is: 39.1

The square root of 39.1 is: 6.25

 

in java

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Array
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT