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 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 24.06.2019 13:10
Write a program that has a conversation with the user. the program must ask for both strings and numbers as input. the program must ask for at least 4 different inputs from the user. the program must reuse at least 3 inputs in what it displays on the screen. the program must perform some form of arithmetic operation on the numbers the user inputs. turn in your .py file as well as a screenshot of your program's output. include comments in your code to explain how it works an example program run might look like (have fun with this and be creative): β€˜what is your name? ’ β€œjosh” β€˜, josh. what is your favorite color? ’ β€œgreen” β€˜mine too. do you also like ice cream? ’ β€œno” β€˜josh, how old are you? ’ β€œ40” β€˜ and how many siblings do you have? ’’ β€œ3” β€˜that means you are one of 4 kid(s). is green the favorite color of anyone else in your house? ’
Answers: 3
question
Computers and Technology, 25.06.2019 10:50
4.9: population write a program that will predict the size of a population of organisms. the program should ask the user for the starting number of organisms, their average daily population increase (as a percentage, expressed as a fraction in decimal form: for example 0.052 would mean a 5.2% increase each day), and the number of days they will multiply. a loop should display the size of the population for each day. prompts, output labels and messages.the three input data should be prompted for with the following prompts: "enter the starting number organisms: ", "enter the daily increase: ", and "enter the number of days the organisms will multiply: " respectively. after the input has been read in successfully, a table is produced, for example: 2 300.0 4 675.0 under the heading is a line of 29 dashes followed by one line for each day, showing the day number and the population at the beginning of that day. input validation.do not accept a number less than 2 for the starting size of the population. if the user fails to satisfy this print a line with this message "invalid. must be at least 2. re-enter: " and try to read the value. similarly, do not accept a negative number for average daily population increase, using the message "invalid. enter a non-negative number: " and retrying. finally, do not accept a number less than 1 for the number of days they will multiply and use the message "invalid. enter 1 or more: ".
Answers: 1
question
Computers and Technology, 25.06.2019 15:00
What is the first step in necessary to begin setting up a website once a host has been selected and paid
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, 19.11.2021 23:20
question
Mathematics, 19.11.2021 23:20
question
Mathematics, 19.11.2021 23:20
question
Mathematics, 19.11.2021 23:30
question
Mathematics, 19.11.2021 23:30
question
Mathematics, 19.11.2021 23:30
Questions on the website: 13722360