Computers and Technology
Computers and Technology, 04.01.2020 22:31, AdoNice

Ihave to write this in java, but i've never even learned it before and i'm completely lost
start a program in a class named arrayprinter. ignore the main method for a moment.
in your class, create a static method named printarray with one parameter of type int[] named arr. inside this method, do the following.

keep all of your output in this method on one line using system. out. print() until directed to use
display an opening square bracket character.
loop through the array that was passed into the method. display the values in the array. add a comma and a space after every value except the last one.
using system. out. display a closing square bracket character.
in your main method, create the following array. pass the reference to this array to the printarray method, run your program, and verify that it works as expected.

int[] oned = {5, 6, 7, 8};
in your main method, add a blank println() statement after the method call you just made.
in the class, create an overloaded static method named printarray with one parameter of type int[][] named arr. inside this method, do the following:
using display an opening square bracket character.
loop through the two-dimensional array that was passed into the method.
first, use system. out. print() to display two space characters.
every element of this two-dimensional array that you are looping through is a one-dimensional array of int. call the other printarray method and pass to it each one-dimensional array in the two-dimensional array.
using display a closing square bracket character.
in your main method, create the following two-dimensional array. pass the reference to this array to the printarray method, run your program, and verify that it works as expected.
int[][] twod = {{2, 4, 6, 8},
{8, 7, 9, 1},
{3, 5, 1, 2}};
in your main method, add a blank println() statement after the method call you just made.
in your main method, create the following ragged two-dimensional array. pass the reference to this array to the printarray method, run your program, and verify that it works as expected.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:40, ihatemylife0
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, Siris420
Plz ( which is an example of a good url?
Answers: 1
image
Computers and Technology, 24.06.2019 12:00, log40
Jack is assisting his younger sibling mary with her mathematics assignment, which includes a study of the number system. jack explains to mary that whole numbers are counting numbers that could be used to record the number of fruits in a basket. which data type represents whole numbers? a. integers. b.floating-point numbers. c. strings. d.boolean
Answers: 1
image
Computers and Technology, 24.06.2019 15:30, sonyfan
What is the total number of time zones that can be configured to show by default in a calendar in outlook 2016?
Answers: 1
Do you know the correct answer?
Ihave to write this in java, but i've never even learned it before and i'm completely lost
sta...

Questions in other subjects:

Konu
Chemistry, 01.04.2021 01:00
Konu
Mathematics, 01.04.2021 01:00