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
Hola buenas tardes, mi problema es el siguiente, en Word quiero alinear los párrafos por separado, pero, así lo sombree una line
Rudik [331]


Usa el botón Tab :)

6 0
3 years ago
Which option describes a balanced slide?
Umnica [9.8K]

Answer: a slide with a size 18 font and five images

Explanation:

the text isnt that big to overpower the images and vise versa

4 0
3 years ago
31. With interactive marketing,
stepan [7]

Answer:

D.

Explanation:

Interactive marketing is a technique in which marketers focus on one-to-one interactions with individual customers as opposed to focusing on the entire population. This shapes the marketing decisions based on the behaviors and preferences of the customers. Therefore with interactive marketing, the buyer controls the kind and amount of information received from the seller.

6 0
3 years ago
What would best describe the future of cybersecurity?
Andrei [34K]

The best describe the future of cybersecurity is strong security policies offer little protection.

<h3>What is cybersecurity?</h3>

Cybersecurity is the security of data or computer systems. Cybersecurity is provided from the hackers that hacks the data and money online.

As everything is converting digital, the need of cybersecurity is increasing.

Thus, the correct option is B.

Learn more about cybersecurity

brainly.com/question/27560386

#SPJ1

5 0
2 years ago
Imagine you are having a conversation about simulation training programs with one of your friends (it is a slow night). You are
Marina86 [1]
I'd simply say that everyone has their own opinions. Some people don't want to experience it in real life because they fear they may mess up. Hence why we have simulations of things, to help people who don't want to experience something in real life and prepare them for when they decide to go out and actually do it.
3 0
4 years ago
Other questions:
  • Do you think social media should affect presidential elections
    6·2 answers
  • The point at coordinates (2, -18) is in what direction from the origin?
    13·1 answer
  • Modern ancestor of the typewriter
    12·2 answers
  • What is Mainframe computer​
    14·1 answer
  • Peter has recently bought a media player and a digital camera he wants to buy a memory card and then use devices which memory do
    11·2 answers
  • Write an if-else statement with multiple branches. If givenYear is 2100 or greater, print "Distant future" (without quotes). Els
    5·1 answer
  • What are the benefits of transferable skills check all the boxes that apply
    6·2 answers
  • Wireless data networks are particularly susceptible to known ciphertext attacks.
    10·1 answer
  • Word-processing,spreadsheets, databases, and desktop publishing are all types of _______?
    12·2 answers
  • What are the words that make up a high-level programming language called?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!