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
Ivanshal [37]
3 years ago
13

Write a program, TwoDimentionalGrid. Ask the user to enter the size of the 2 dimensional array. Here we are not doing any input

validation. We are assuming, user is going to enter a number greater than 1. Create a 2D array with the same row and column number. Now print the array as a number grid starting at 1. Example: At place row number 3 and column number 2, number would be 6 (3*2). Any number would be the product of it's row number and column number. Hint: Use setw 5. Expected Output: Here I am attaching 2 expected output. Make sure your code is running for both input.
Computers and Technology
1 answer:
Nitella [24]3 years ago
4 0

Answer:

The program in Java is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 System.out.print("Array size: ");

 int n = input.nextInt();

 int[][] myarray = new int[n][n];

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

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

         myarray[i][j] = i * j;      }  }

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

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

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

     System.out.println();  }

}}

Explanation:

This prompts the user for the array size

 System.out.print("Array size: ");

This gets input for the array size

 int n = input.nextInt();

This declares the array

 int[][] myarray = new int[n][n];

This iterates through the rows

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

This iterates through the columns

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

This populates the array by multiplying the row and column

         myarray[i][j] = i * j;      }  }

This iterates through the rows

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

This iterates through the columns

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

This prints each array element

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

This prints a new line at the end of each row

     System.out.println();  }

}

You might be interested in
An insurance company utilizes SAP HANA for its day-to-day ERP operations. Since they can’t migrate this database due to customer
hichkok12 [17]

Answer: An Internet-routable IP address (static) of the customer gateway's external interface for the on-premises network

Explanation:

Based on the information given, an Internet-routable IP address (static) of the customer gateway's external interface for the on-premises network need to be configured outside of the VPC for them to have a successful site-to-site VPN connection.

The Internet-routable IP address will be used in the identificatiob of each computer through the use of the Internet Protocol for the communication over a network.

3 0
3 years ago
What are the supercomputers and where are they used? ​
viktelen [127]

Answer:

Giant Tech Company mostly

Explanation:

they used it as their server or storing data, right now example we googling by that we send the requests from our computer to supercomputers and those computer will find that information your and send back the respond (e.g. website Brainly). Supercomputers = computers sample as that.

6 0
2 years ago
A technician needs to be prepared to launch programs even when utility windows or the Windows desktop cannot load. What is the p
lisov135 [29]

Answer:

Windows includes a tool called Microsoft System Information (Msinfo32.exe). This tool gathers information about your computer and displays a comprehensive view of your hardware, system components, and software environment, which you can use to diagnose computer issues.

Explanation:

7 0
3 years ago
Azzam is reviewing a paper he just wrote about kinetic friction for his physics class. On the third page, he realizes that every
bogdanovich [222]

Answer: Azzam used the tool while he was on the third page

Explanation:

The most likely the reason why the phrase was not fixed is because Azzam used the tool while he was on the third page.

This can be infered from the information given when we're told that he uses the Find and Replace tool and clicks on "Replace All" to fix the issue with regards to the error that he made and thus was done from the third page. Therefore, the tool might not have worked for the first page.

4 0
3 years ago
To use patterns and observations to say what happens next
posledela
You would need to show a pic
4 0
3 years ago
Other questions:
  • According to the video, which of the following is communication between two individuals? Intrapersonal Communication Public Spea
    7·2 answers
  • To access your gradebook you click on the __________.
    6·2 answers
  • In which of the following work situations would word processing software be most appropriate to make the task easier?
    6·1 answer
  • Who distributes IP Address?
    10·1 answer
  • Excel spread sheets are primarily used to
    13·2 answers
  • Write about storage<br>(should be in easy words)​
    8·1 answer
  • Reply emailing a student who is asking about audio materials​
    6·2 answers
  • You cannot then move and resize the control on the form as desired with your mouse TRUE OR FALSE​
    6·2 answers
  • --concept mapping--
    5·1 answer
  • What is cyber security ???​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!