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, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
question
Computers and Technology, 23.06.2019 10:20
Suppose there is a relation r(a, b, c) with a b+-tree index with search keys (a, b).1. what is the worst-case cost of finding records satisfying 10 < a < 50 using this index, in terms of the number of records n1, retrieved and the height h of the tree? 2. what is the worst-case cost of finding records satisfying 10 < a < 50 and 5 < b < 10 using this index, in terms of the number of records n2 that satisfy this selection, as well as n1 and h defined above? 3. under what conditions on n1 and n2, would the index be an efficient way of finding records satisfying the condition from part (2)?
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
question
Computers and Technology, 24.06.2019 09:50
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
Answers: 1
You know the right answer?
This is java and must follow the instruction and must put //(comment) and make simple program. you...
Questions
question
Mathematics, 04.11.2020 03:30
question
Mathematics, 04.11.2020 03:30
question
Health, 04.11.2020 03:30
question
Mathematics, 04.11.2020 03:30
question
Mathematics, 04.11.2020 03:30
question
Mathematics, 04.11.2020 03:30
question
Mathematics, 04.11.2020 03:30
Questions on the website: 13722363