subject

This is java and must follow the instruction and must put //(comment) and make simple program. you1. in this problem, we are going to practice creating, printing, and updating arrays. a. create a class named arraypracticeb. create an instance variable named numbers. it should be an array that holds 20 integers. c. create a constructor that initializes numbers. the heading should look like this public arraypractice(int[] num)d. create a method called printforward. in the method using println print the line: this prints the array forward. this method should then print the array from the beginning (first element) to the end (last element). use print and print a space between each element. use the enhanced for loop to print the array. e. create a method called printbackward. in this method using println, print the line: this prints the line backward. use print and print the array from the end (last element) to the beginning (first element). print all elements on one line with a space between each element. you can use any type loop you want. f. create a method called printodd. in this method using println print the line: this prints the odd index variables, and then use print and print every element at an odd index. you may use anytype loop you want. g. create a method called printeven. in this method using println, print the line: this prints the odd index values and the use print to print every element at an even index. you may use any typeloop you want. print all elements on one line with a space between each element. h. create a method called printfirstandlast. in this method using println, print the line: this prints the first and last elements of the array. print the first element in the array and the last element in the array on one line using print. i. create a method called addone. using a loop, add 1 to each element in the array and then call the method printforward. create a arraypracticetester. k. import java. util. randomprin; l. create an integer array named values. it should hold 20 values. m. create a random number generator by typing. random generator = new random(); n. create a loop – you choose the type. you will fill he array from random numbers generated. your numbers will be between 1 and 100. inside the loop put code to put a random number in the array. use this code: values[i] = 1+ generator. nextint(100); o. after you have filled the array, create an arraypractice object. put the array name in the argument. arraypractice ap=new arraypractice(values); p. call each of the method in the class, arraypractice.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
You need a reliable network for about twenty-five computers that will be distributed across a large building. it is important that the network be relatively cheap. which topology should you use?
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
If chris has a car liability insurance, what damage would he be covered for
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
What is a programming method that provides for interactive modules to a website?
Answers: 1
question
Computers and Technology, 24.06.2019 10:50
In 2009 to 2010, how many social network users were reported as being victims of online abuse? a. 1 in 10 b. 100% c.1 in 100 d. 50%
Answers: 2
You know the right answer?
This is java and must follow the instruction and must put //(comment) and make simple program. you...
Questions
question
Chemistry, 09.11.2019 04:31