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
mestny [16]
3 years ago
14

1) Create the following 2D array in one instruction: {{1,2,3,4,5}, {1,2,3,4,5}, {1,2,3,4,5}} // your code goes below:

Computers and Technology
1 answer:
zzz [600]3 years ago
4 0

Answer:

1)

int[][] a2dArray = {{1,2,3,4,5},{1,2,3,4,5},{1,2,3,4,5}};

2)

public class Main

{

public static void main(String[] args) {

   

    int[][] a2dArray2 = new int[3][5];

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

        a2dArray2[i] = simpleArray(5);

    }

   

    for (int i=0; i<a2dArray2.length; i++) {

        for (int j=0; j<a2dArray2[i].length; j++){

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

        }

        System.out.println();

    }

 

}

public static int[] simpleArray(int n){

    int[] result = new int[n];

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

        result[i] = i+1;

    }

    return result;

}

}

Explanation:

1) To create a 2D array you need to write the type, two brackets and the name on the left hand side. Put the values on the right hand side.

2) Declare the array. Since there will be 3 rows and 5 columns, put these values in the brackets on the right hand side.

Create a for loop that iterates 3 times. Call the method simpleArray inside the loop so that each row of the a2dArray2 array will be set. Be aware that simpleArray method takes an integer as parameter and creates a 1D array, the numbers in the array starts from 1 and goes to the parameter value. That is why calling the method simpleArray (with parameter 5) 3 times will create a 2D array that has 3 rows and 5 columns.

Then, use a nested for loop to display the 2D array.

You might be interested in
Which of the following must be configured in certain applications to help ensure data aggregation and data isolation are impleme
Hitman42 [59]

Answer: (B) Log forwarding and (F) Zones

Explanation:

 According to the given question, the log forwarding and the zones are the  applications that are configured for ensuring the data isolation and aggregation that are implemented on the various types of critical devices and the applications.

  • The log forwarding is one of the type of application that are used for correlated the various types of events from the multiple resources from the one Forti-analyzer to the another unit.
  • The zones is one of the type of virtual system that are used in multiple resources.

Therefore, Option (B) and (F) is correct.

5 0
3 years ago
An electronic resume is a plain-looking document. True of False?
Contact [7]
I think it's TRUE!!!!!!!!!!
8 0
4 years ago
Read 2 more answers
Tech A says that gasoline vapors are lighter than air, so inspection pits do not have a fire hazard like above ground hoists. Te
Elden [556K]

Answer:

Tech B is correct.

Explanation:

First, It is international best practice never to exceed the lifting capacity of any hoist. To do so would expose those involved to risks that may prove to be fatal.

Second, research has shown that gasoline vapors, as well as vapor from almost all other flammable or ignitable liquids or substances, are heavier than air.

More specifically, Gasoline produces flammable vapors that are heavier than air by 3 to 4 times. This means they can travel for great distances along the ground. Worst still, inspection pits are must be kept free from gas vapors because they tend to accumulate in low or enclosed spaces.

Both technicians should and must observe all occupational, health, and safety rules and guidelines stipulated and required for their industry/practice.

Cheers

4 0
3 years ago
The Scientific Method is a/an
ser-zykov [4K]

Answer:

It's a method used in science to ask questions, research, observe, hypothesize, experiment, analyze data, and make conclusions.

Explanation:

5 0
3 years ago
Read 2 more answers
What is the purpose of the Zoom dialog box? to put the selected range in ascending order in a query to put the selected range in
AlekseyPX

The zoom dialog box helps to enter text and expressions in tight places, such as a property sheet or Query Design view. You can resize the zoom box and change the font. And the zoom box remembers the size and font each time you use it.

Use the

5 0
3 years ago
Read 2 more answers
Other questions:
  • Regarding an intrusion detection system (IDS), stateful matching looks for specific sequences appearing across several packets i
    9·1 answer
  • Colin Mackay Inc., a software company with its head office in Amsterdam, has employees across three continents. The company's pr
    10·1 answer
  • which of the following is a component of a rope-rewind starter system? a. a recoil spring c. an air vane governor b. a wrist pin
    5·1 answer
  • When you make taffy (a pliable candy), you must heat the candy mixture to 270 degrees Fahrenheit.
    8·1 answer
  • Universal Containers uses a custom object within the product development team. Product development, executives, and System Admin
    11·1 answer
  • Where in PowerPoint should a user navigate to complete the tasks listed below?
    6·1 answer
  • Procedural programs specify instructions that a processor must execute to perform computations. These programs sometimes consist
    11·1 answer
  • Group of programs are software <br>​
    11·1 answer
  • The hexadecimal eqquivalent of (80)10 is
    11·1 answer
  • Multiple Select Which of these are ways a hacker might learn someone's password? Select 3 options. o social engineering keylogge
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!