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]
4 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]4 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
HURRY please!!!!
shutvik [7]
1. Go to insert tab
2. Click the chart tab
3. Choose the type of chart
4. Click OK
3 0
3 years ago
Where Can I Get Actual Microsoft AZ-900 Exam Questions?
Pachacha [2.7K]

Answer:

Pls check the site "examtopics"

U fill find ur questions there

8 0
4 years ago
Drag the tiles to the boxes to form correct pairs.
Sergio [31]

Answer:

An overhead projector: requires slides to project images

A laptop: requires an external monitor to project high-resolution images

A computer: requires a CD-ROM drive to run presentation CDs

An external monitor: requires a port to connect to the laptop

Explanation:

The correct pair has been formed above. An overhead projector requires the slides for projecting images. A Laptop for projecting high-resolution images requires an external monitor. And a computer requires a CD-ROM drive for running presentation CDs, and an external monitor requires a port to a port which can be an HDMI port to connect to a laptop.

8 0
3 years ago
4.15 LAB: Password modifier
Black_prince [1.1K]

I've included my code in the picture below. Best of luck.

3 0
3 years ago
After trying multiple times, a coworker is not able to fit a motherboard in a computer case, and is having difficulty aligning s
Allisa [31]

Answer:

D) The board is not oriented correctly in the case. Rotate the boar

Explanation:

<u>Let's check the answer options</u>

A) The coworker is trying to use too many screws to secure the board; only four screws are required.

- Incorrect, as more than four screws are required

B) The form factors of the case and motherboard don’t match.

- Incorrect, in this scenario motherboard wouldn't fit the case

C) The form factors of the motherboard and power supply don’t match.

- Incorrect, PSU is not relevant in aligning the screw holes

D) The board is not oriented correctly in the case. Rotate the boar

- Correct, this is the most likely cause

5 0
3 years ago
Other questions:
  • A benefit of IPsec is __________.
    8·1 answer
  • Using a wireless network without the network owner's permission is known as ________.
    15·1 answer
  • What does ADF means????
    13·2 answers
  • While performing disk and file maintenance on the company file server, you determine a user in the accounting department has bee
    13·2 answers
  • Missing slot covers on a computer can cause?
    9·1 answer
  • What type of address uses a number that uniquely identifies each computer?
    6·2 answers
  • 8.Which of the following IC was used in third generation of computers?Immersive Reader
    13·1 answer
  • What are the possible consequences of plagiarism?
    15·1 answer
  • What is the main function of a file extension?
    10·1 answer
  • What virtual, logically defined device operates at the data link layer to pass frames between nodes?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!