Question: write code to complete the pseudocode written in the java file import java.util.*;/*-------------------------------------------------------------------------------------*//* Complete each task below. You will know that you are finished when

write code to complete the pseudocode written in the java file

import java.util.*;/*-------------------------------------------------------------------------------------*//* Complete each task below. You will know that you are finished when this program*//* compiles and produces the correct output. Submit your code in Canvas when finished. *//*-------------------------------------------------------------------------------------*/public class ConstructingArrays { public static void main (String[] args) {//=========================================================================================== // 1) Declare an array that stores 8 elements of type int and print out the results of // element (without using a for loop) to show how Java auto-initializesyour elements!//=========================================================================================== System.out.println(); //=========================================================================================== // 2) Declare an array that stores -2,6,9,1,15,42,-13,444,-1,-66 using onestatement. // then use a loop to print the string "-2,6,9,1,15,42,-13,444,-1,-66" //=========================================================================================== System.out.println();//=========================================================================================== // 3) Declare an array that stores the following strings // "Welcome","back","to","school","2021","is","here!" // then use a loop to print the string //=========================================================================================== System.out.println();//================================================================================================ // 4) Constructs a new array with 5 elements, and fill the array with 5 consecutive

// positive integers using a for loop. Print the arrays elements.//================================================================================================ System.out.println();//================================================================================================== // 5) Construct a loop that will grab input from the user and traverse thearray to fill it in. // Print the array to prove your code is correct.//================================================================================================== System.out.println();//================================================================================================= // 6) Using only one statement, declare an array called 'arr5' that contains the follow // 5 integer values: -4, 19, 3, 20, 72.//================================================================================================= System.out.println();//=================================================================================================== // 7) Using arr5.length, write code that will output the last value of thearr5.//=================================================================================================== System.out.println();//=================================================================================================== // 8) Generate code to output the middle value of the arr5 using array.length//=================================================================================================== System.out.println();//=================================================================================================== // 9) Using the arr5, write code that decrements each element by 1 and // outputs the resulting values of the array.

//=================================================================================================== System.out.println();//=================================================================================================== // 10) Construct an array called 'even' that stores the first 499 even integers // starting at 0.//=================================================================================================== System.out.println();//=================================================================================================== // 11) Write code that will output the value at index 100 in array 'even'.//=================================================================================================== System.out.println();//=================================================================================================== // 12) Write code that accesses array even and prints the value at indexes 278 and 456. //=================================================================================================== System.out.println();//=================================================================================================== // 13) Write code that stores all odd numbers between -4 and 5 into an array using a loop. // Make the arrays size exactly large enough to store the numbers (including -4 and 5). // Print the array to prove your results. //=================================================================================================== System.out.println();//=================================================================================================== // 14) Try generalizing your code from Problem 12 so that it will work for // any minimum and maximum values, not just -4 and 5. To test your generalized code, // use the modeling supplies to test out your code using different

values.//=================================================================================================== }

}

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!