1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kisachek [45]
3 years ago
13

Write a Java program in jGRASP that creates a 2D integer array of 5 rows and 20 columns, fills it with increasing integer values

ranging from 0 to 59 and then prints the array
Computers and Technology
1 answer:
Alex73 [517]3 years ago
7 0

Answer:

As per the question we need to make 5 rowa and 2o columns, in this we have total element 100 so range should be 0 to 99, but we are suggested to keep range 0 to 59, so i have kept the elementns in the range, but if it was a typo in the question for range you do not need to reset the k with zero.

Explanation:

//create a new class  TestArray

public class TestArray {

//define main method

public static void main(String[] args) {

 //declare a 2D array of given size i.e. 5 rows and 20 columns

 int arr[][] = new int[5][20];

 //declare an integer variable k and initialize it with zero, this will used to initialize the array from 0 to 99

 int k = 0;

 //for loop for rows

 for (int i = 0; i < 5; i++) {

  //for loop for columns

  for (int j = 0; j < 20; j++) {

   //initialize arr with the current value of k

   arr[i][j] = k;

   //once k is 59 set it zero again as we are not going beyond 59

   if(k == 59)

    k = 0;

   //increment value of k with 1

   k++;

  }

 }

 //print the element from the array one by one

 //for loop for rows

 for (int i = 0; i < 5; i++) {

  //for loop for columns

  for (int j = 0; j < 20; j++) {

   //print the current element of array and an space with it

   System.out.print(arr[i][j]+" ");

  }

  // move the cursor to new line

  System.out.println();

 }

}

}

You might be interested in
Please help me what is an example of a growing trend on social media
Marizza181 [45]

Answer:

B

Explanation:

8 0
3 years ago
Create a project for a sandwich shop. The project, named SalsSandwiches, allows a user to use a ListBox to choose a type of sand
nirvana33 [79]

Answer:

Create a new C# windows application with the name SalsSandwiches. Add the below code in respective file.

Explanation:

See attached images for the source code and output

7 0
3 years ago
Online databases allow you access to material you may not be able to find when using popular search engines like Google. Select
Anna007 [38]

Answer:

True

Explanation:

6 0
3 years ago
Describe the Order of Operations in Java programming.
cestrela7 [59]

Answer:

It stands for Parentheses, Exponents, Multiplication/Division, Addition/Subtraction. PEMDAS is often expanded to the mnemonic "Please Excuse My Dear Aunt Sally" in schools. Canada and New Zealand use BEDMAS, standing for Brackets, Exponents, Division/Multiplication, Addition/Subtraction.

5 0
3 years ago
In order for the wavelength of a wave to increase, the frequency must...
kari74 [83]
Decrease. Think like this, if you were standing in the ocean getting hit by waves, frequency would be how many waves hit you in a certain amount of time. If there were lots of little waves hitting you the number of waves (the frequency) would be high, whereas big waves are slower and take more time to reach you so you would get hit by less of them in the same time frame. The less frequent, the longer the wave. 
7 0
3 years ago
Other questions:
  • ____ are the computers that store network software and shared or private user files.
    6·1 answer
  • The cost of large ground based telescopes has remained the same since the 1800's costing the equivalent of about a billion dolla
    9·1 answer
  • Consider a computer system, where each processor can independently perform a separate task. given that the response time on a co
    10·1 answer
  • What can be said about the equipment used by photographers during the Civil War?
    13·2 answers
  • Using either a UNIX or a Linux system, write a C program that forks a child process that ultimately becomes a zombie process. Th
    8·1 answer
  • Assembly (Procedure and Conditional Processing). For the following program, what are outputs for register EAX, EBX, ECX, and EDX
    11·1 answer
  • n physics, a common useful equation for finding the position s of a body in linear motion at a given time t, based on its initia
    9·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    5·1 answer
  • Java code?????
    12·1 answer
  • Which Artificial Intelligence (AI) term is used to describe extracting information from unstructured text using algorithms?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!