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]
4 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]4 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
If ClassC is derived from ClassB which is derived from ClassA, this would be an example of ________.
finlep [7]

Answer:

Inheritance

Explanation:

8 0
3 years ago
I connected to an external hard drive to transfer some photos from my vacation. When I try to drag the photo, it bounces right b
Ilia_Sergeevich [38]
Your answer is D.

Hope this helps and if you could answer the question I just uploaded titled giving brainliest that would be great. Basically, what you have to do is research why the book titled the list of things that will not change and explain why it’s your favorite book based on the message it tells you! Go to my profile and go to questions.
7 0
3 years ago
Given a Scanner reference variable named input that has been associated with an input source consisting of a sequence of strings
Ghella [55]

Answer:

count = 0;

longest =0;

String myString = new String();

while (input.hasNext()){

myString = input.next();

if (myString.length() == longest) count++;

else

if (myString.length() > longest){

longest = myString.length();

count = 1;

}

}

Explanation:

5 0
3 years ago
Read 2 more answers
Why are the download speeds on my computer slower than usual
OLEGan [10]

Answer:

There may be other devices on your network within your household or a higher than normal amount outside of it.

Explanation:

The number of devices actively <em>using</em> your network can take up your bandwidth and reduce your download speeds. If you have devices downloading, gaming, or streaming it can cause this.

There also may be a large number of people using your internet provider at the same time, which will slow down the overall connection speed.

5 0
2 years ago
Which one of the following is a benefit of using a contact group?
lisov135 [29]

Answer:

There are some benefit of using a contact group.

Explanation:

An email address collection consists of a contact group (formerly known as a "distribution list."). You can send an E-mail or invitation to meet to all addresses at the same time by using a contact group. In the messages, task requests, requests for meetings, and other contact groups you can include contact groups. Another advantage of contact groups is that they categorize your contacts so that a particular person can be found more easily in future. Depending on how far you want to reach with your contact organization, you can contact one group or more groups

6 0
3 years ago
Other questions:
  • If I deal seven cards from a standard deck of 52, what is the chance that I will get two triples (three of a kind) and one other
    11·2 answers
  • Select the strategies below that are likely to increase audience attention.
    14·2 answers
  • Which of the following is considered both an input and output peripheral?
    10·1 answer
  • Which phrase best describes a spreadsheet?
    5·2 answers
  • Easy 25 points answer what is it called that you use only 1 and 0 like this 1010010011001100011110001010010101001010101010010101
    5·1 answer
  • Error: 404 Not Found <br>The resource that you requested does not exist on this server.
    14·2 answers
  • Which command should you select to track changes in a document?
    9·2 answers
  • VOTE: STARWARS, STAR TREK, MARVEL, STRANGER THINGS. OR IT ?
    15·2 answers
  • Weird canvas submission, I’ve done directly what the directions say to do to submit it, but it won’t submit
    15·1 answer
  • How can a user remove or delete a Pivot Table?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!