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 please
- Define and instantiate an array of integers with ten elements.
- Fill in the array with integers from 1 to 100.
- To preserve the initial array, define another array named temp and copy the initial array in it.
- Define the variables you need to calculate the following values and initialize them with appropriate values.
- 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.
- All tasks are listed in the template file, ArrayCommonOperations.txt. Download the template file and save it as ArrayCommonOperations.java.
- Go through the file, and identify the tasks you have to complete, which are clearly marked throughout the file. Complete all the required tasks.
- 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
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