Question: Please follow the steps to complete this guided assignment: Java please Define and instantiate an array of integers with ten elements. Fill in the array

Please follow the steps to complete this guided assignment: Java pleasePlease follow the steps to complete this guided assignment: Java please Define

  1. Define and instantiate an array of integers with ten elements.
  2. Fill in the array with integers from 1 to 100.
  3. To preserve the initial array, define another array named temp and copy the initial array in it.
  4. Define the variables you need to calculate the following values and initialize them with appropriate values.
  5. Perform the following tasks:
    • Print the original array.
    • Calculate the sum of all values.
    • Count the number of even values.
    • Calculate the minimum value in the array.
    • Calculate the maximum value in the array.
    • Replace the elements that are divisible by 3 with their value plus 2
    • Print the new array after replacement.
    • Display the calculated values.
  6. All tasks are listed in the template file, ArrayCommonOperations.txt. Download the template file and save it as ArrayCommonOperations.java.
  7. Go through the file, and identify the tasks you have to complete, which are clearly marked throughout the file. Complete all the required tasks.
  8. If all the required methods are implemented properly, the driver program should generate outputs similar to the following:

I am mostly stuck on task ten

public class ArrayCommonOperations {

public static void main(String [] args)

{

//*** Task #1: Define and instantiate an array of integer numbers, with 10 elements

//*** Task #2: Fill in the array with integer numbers from 1 to 100

//*** Task #3: define another array, named temp, and copy the initial array in it.

//* This allows to preserve the original array

//*** Task #4: Define the variables you need to calculate the following values

,//* and initialize them with appropriate values

.//*** Task #5: Print the original array

//*** Task #6: Calculate the sum of all values

//*** Task #7: Count the number of even values

//*** Task #8: Calculate the minimum value in the array

//*** Task #9: Calculate the maximum value in the array

//*** Task #10: Replace the elements that are divisible by 3, with their value plus 2

//*** Task #11: Display the new array after replacement

//*** Task #12: Display the calculated values.}}

66 28 5 24 68 28 5 26 The original array has the following values: 47 21 57 51 75 65 The original array has the following values: 47 23 59 53 77 65 Sum of values in the array: 439 Count of even values in the array: 3 Minimum value in the array: 5 Maximum value in the array: 75 Press any key to continue

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!