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
insens350 [35]
3 years ago
9

What is the printout (display) of the following program? public class Test { public static void main(String[] args) { int[][] va

lues = {3, 4, 5, 1}, {33, 6, 1, 2}; int v = values[0][0]; for (int row = 0; row < values.length; row++) for (int column = 0; column < values[row].length; column++) if (v < values[row][column]) v = values[row][column]; System.out.print(v); } }
Computers and Technology
1 answer:
vodka [1.7K]3 years ago
8 0

Answer:

The printout of the program is 33

Explanation:

Given the code as follows:

  1.        int[][] values = {{3, 4, 5, 1}, {33, 6, 1, 2}};
  2.        int v = values[0][0];
  3.        for (int row = 0; row < values.length; row++)
  4.            for (int column = 0; column < values[row].length; column++)
  5.                if (v < values[row][column])
  6.                    v = values[row][column];
  7.                System.out.print(v);

The code above will find the largest value from the two-dimensional array and print it out.

The logic of finding the largest value is as follows:

  • Create a variable, <em>v</em>, to hold the largest number (Line 2). At the first beginning, we simply set the value from the first row and first column (values[0][0])  as our current largest value.
  • Next, we need to compare our current largest value against the rest of the elements in the two dimensional array.
  • To make the comparison, we need a two-layers for loops that will traverse through every row and column of the array and compare each of the element with the current largest value (Line 3-6).
  • If the current largest value, v, is smaller than any element of the array, update the <em>v</em>  to the latest found largest value (Line 5-6).
  • After completion of the for-loop, the v will hold the largest number and the program will print it out (Line 8).
You might be interested in
________ employees state-of-the-art computer software and hardware to help people work better together.
natulia [17]

The correct answer is collaborative computing

Using state-of-the-art computer software and hardware to help people work better together is known as collaborative computing. Goal setting and feedback will be conducted via Web-based software programs such as eWorkbench, which enables managers to create and track employee goals.

6 0
3 years ago
Adam is using the software development life cycle to create a new game. He made an outline of what functionality the game will r
Olin [163]

Answer:

Write pseudocode and create a mock-up of how the game will work and look

Explanation:

Since in the question it is mentioned that Adam wants to develop a new game for this he made an outline with respect to game functions needed, time period, people who help him.

After that, he writes the pseudocode i.e a programming language and then develops a model i.e mock up that reflects the working of the game and its look so that he would get to know how much work is pending.

3 0
3 years ago
What is the recommended procedure for disconnecting an external hard drive to avoid losing data?
Zina [86]

Answer:

Instruct the operating system to eject the drive before unplugging it.

Explanation:

3 0
3 years ago
Bakit mahalaga na marunong tayong gumamit ng makina?
jeka94

Answer:

para mabilis ang gawa

Explanation:

hope it helps

5 0
3 years ago
What special signal is issued periodically from an Access Point and contains the network transmission rate and service set ident
olya-2409 [2.1K]

Answer:

beacon frame  

Explanation:

Beacon frame is a management frame In computer networks, known to be in IEEE 802.11 based WLANs. These frames are transmitted periodically and they contain all the  information a station will require before it can rightly transmit a frame.  

When it comes to announcing the presence of devices in a wireless computer network (WLAN), Beacon frames are used, and they can also be used in the synchronization of the devices and services

6 0
2 years ago
Other questions:
  • From the video "Your Password Sucks", using computer power to guess your password by trying multiple variations one after the ot
    15·2 answers
  • An OS X backup utility that automatically backs up files to a dedicated drive that is always available when the computer is turn
    6·1 answer
  • A person who wants to buy a compact disc (cd) has just enough money to buy one, and chooses cd a instead of cd
    10·2 answers
  • A financially stable person is able to
    12·2 answers
  • Does a BIOS reset erase data such as pictures, programs or other things like that?
    13·1 answer
  • Ashley works for a movie theater. The theater has decided to host some special events over the summer. She needs to communicate
    8·2 answers
  • Create a program in Python that prompts the user to enter an integer number within the range of 1 to 10 inclusive. The program s
    15·2 answers
  • ​Lara is the chief editor of "Laughter and Life," an online magazine. Lara has assigned Jenny the task of redesigning the magazi
    5·1 answer
  • A connection between files that allows data to be transferred from one file to another is a _______________________.
    6·1 answer
  • 2.4 Code Practice: Question 2
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!