Question: Create a Java class with name: Assignment3 In the main() method do Create an array called array1 of length 100 with initial values {1, 2,

  1. Create a Java class with name: Assignment3
  2. In the main() method do
    1. Create an array called array1 of length 100 with initial values

{1, 2, , 100} using a for loop, and then calculate the sum of all the values in the array. Furthermore, display the sum.

  1. Create an array called array2 of length 10,000 with initial values

{1^2, 2^2, 3^2, , 100^2} using a for loop and the pow method in the built in Math class. Then calculate the sum of all the values in the array. Furthermore, display the sum.

  1. Use a for loop to assign the square roots of the integers from 1 to 1,000,000 to an array called array3. The compute the arithmetic average of all the numbers in array3. Moreover, display the average.

  1. Put the cubes of all the integers from 1 to 10 into a loop called array4, and then compute the geometric average of the integers in array4. Furthermore, display the final result.

    Comments: should describe what your programs want to do. There are usually five types of comments on

  2. classes, telling what they do
  3. variables, telling their meanings
  4. methods, showing their purposes
  5. algorithms, describing their goals and key steps
  6. a piece of code, showing its purpose and key steps

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!