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
business owners and managers may first balk at the idea of mobile officer workers because there may appear to be a lack of ___ w
Tcecarenko [31]
Business owners and managers may first balk at the idea of mobile officer workers because there may appear to be a lack of ___ when employees are not sitting at a desk in the office

Lack of control, supervision (I.e. micro-management lol).
5 0
3 years ago
Can java scanner not take in a negative input?
algol [13]

Answer:

It can take a negative input

Explanation:

When you declare a variable in Java and you get your input via Scanner library; the Scanner library will accept the input irrespective of whether it's negative or not.

Take for instance, the following segment

<em>Scanner input = new Scanner(System.in);</em>

<em>int userinput = input.nextInt()</em>

<em />

Irrespective of whether userinput is negative or positive, it'll accept it.

8 0
3 years ago
What is meant by usability and what characteristics of an interface are used to assess a system’s usability?
ahrayia [7]

Answer:

The answer is below

Explanation:

Usability is a term that describes the assessment of the performance of a system in assisting the task of the user, or how effective a certain product system or design supports the task of a user in accomplishing a set out objective as desired.

The characteristics of an interface that are used to assess a system’s usability are:

1. Effectiveness

2. Efficiency

3. Error Tolerance

4. Engagement

5. Ease of Learning and Navigation

3 0
3 years ago
To make it easier to enter names into your code, NetBeans provides a feature known as
Alexus [3.1K]

Answer:

Code completion.

Explanation:

The NetBeans is an integrated development environment framework of java language. Code completion is the features of NetBeans which is easier to complete the code This feature is known as smart code features because it completes the code in a very easy manner. The Code completion features are needful when we have to fill the missing code or program in the java language.  

Hence Code completion.  is used to enter the name into the code in the  NetBeans.

3 0
3 years ago
Eniac was the first desktop computer. t/f
LekaFEV [45]

Answer:

The answer is "False".

Explanation:

ENIAC stands for Electronic Numerical Integrator and Computer, It was first developed in 1946. This computer use circuits and node that are interconnected with each other to show the result.

  • ENIAC was a firstly, Reconfigurable vacuum tube, that controls the unit and it doesn't store information
  • It takes a large room to set up the system, that's why it is not true.

6 0
4 years ago
Other questions:
  • whats something that u want to do but ur parents wont allow it like having a phone or going to a college ​
    11·2 answers
  • What important Apple computer (with a GUI OS) was introduced in 1984? Apple I?
    13·1 answer
  • Is this statement true or false?
    13·1 answer
  • Powerpoint s _____ feature allows you to set the timing for a video clip
    12·1 answer
  • Describe how you would switch between the virtual consoles provided by Fedora.
    10·1 answer
  • Which one is a certain sign that a website is not reliable?
    6·2 answers
  • Write a line of code to convert time to hours. Remember there are 60 minutes in an hour. Then write a line of code to calculate
    9·2 answers
  • Which of the following was (and still is) used by computer programmers as a first test program?
    13·2 answers
  • What is the most common etical rule that must be applied in all technologies​
    5·1 answer
  • Why is it important to perform routine computer maintenance? It can make more room for junk files and downloadable programs. It
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!