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
brilliants [131]
3 years ago
13

Write a function named findmax()that finds and displays the maximum values in a two dimensional array of integers. The array sho

uld be declared as a 10 row by 15 column array of integers in main()and populated with random numbers between 0 and 100.
Computers and Technology
1 answer:
Kazeer [188]3 years ago
3 0

Answer:

import java.util.*;

public class Main

{

public static void main(String[] args) {

    Random r = new Random();

    int[][] numbers = new int[10][15];

   

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

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

            numbers[i][j] = new Random().nextInt(101);

        }

    }

   

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

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

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

        }

        System.out.println();

    }

   

    findmax(numbers);

}

public static void findmax(int[][] numbers){

    int max = numbers[0][0];

   

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

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

            if(numbers[i][j] > max)

                max = numbers[i][j];

        }

    }

    System.out.println("The max is " + max);

}

}

Explanation:

*The code is in Java.

Create a function called findmax() that takes one parameter, numbers array

Inside the function:

Initialize the max as first number in the array

Create a nested for loop that iterates through the array. Inside the second for loop, check if a number is greater than the max. If it is set it as the new max

When the loop is done, print the max

Inside the main:

Initialize a 2D array called numbers

Create a nested for loop that sets the random numbers to the numbers array. Note that to generate random integers, nextInt() function in the Random class is used

Create another nested for loop that displays the content of the numbers array

Call the findmax() function passing the numbers array as a parameter

You might be interested in
Which printing options are available in the Print menu? Check all that apply.
sasho [114]

1

3

4

6

mam nadzieje że pomogłem                                                  

6 0
3 years ago
Read 2 more answers
How do you loop a makebeat in earsketch
Anettt [7]

Answer:

i dont know if this help but To do this, we will use a 'for loop'. The “for loop” allows the programmer to call a section of code repeatedly within a range of values. The range() function will return integer values depending on the arguments.

Explanation:

5 0
3 years ago
Define Auxiliary memory?​
andrew-mc [135]

Answer:

An Auxiliary memory is referred to as the lowest-cost, highest-space, and slowest-approach storage in a computer system. It is where programs and information are preserved for long-term storage or when not in direct use. The most typical auxiliary memory devices used in computer systems are magnetic disks and tapes. :)

5 0
3 years ago
Read 2 more answers
In case of rdt 3.0 Stop and Wait, suppose we send a packet of 1KB through 1 Gbps link and RTT=20 msec. Find the sender utilizati
Mamont248 [21]

Answer:

a. Utilization =  0.00039

b. Throughput = 50Kbps

Explanation:

<u>Given Data:</u>

Packet Size = L = 1kb = 8000 bits

Transmission Rate = R = 1 Gbps = 1 x 10⁹ bps

RTT = 20 msec

<u>To Find </u>

a. Sender Utilization = ?

b. Throughput = ?

Solution

a. Sender Utilization

<u>As Given </u>

Packet Size =  L = 8000 bits

Transmission Rate = R = 1 Gbps = 1 x 10⁹ bps

Transmission Time = L/R = 8000 bits / 1 x 10⁹ bps = 8 micro-sec

Utilization =  Transmission Time / RTT + Transmission Time

                 =  8 micro-sec/ 20 msec + 8 micro-sec

                 =  0.008 sec/ 20.008 sec

Utilization =  0.00039

b. Throughput

<u>As Given </u>

Packet Size = 1kb

RTT = 20ms = 20/100 sec = 0.02 sec

So,

Throughput = Packet Size/RTT = 1kb /0.02 = 50 kbps

So, the system has 50 kbps throughput over  1 Gbps Link.

5 0
3 years ago
Social networking sites like Office Online, PayPal, and Dropbox are used to develop social and business contacts.
Vadim26 [7]
False. Those are not social networking sites, and they don't develop contracts.
5 0
3 years ago
Read 2 more answers
Other questions:
  • Describe the role of a chemist and the role of a chemical engineer
    9·1 answer
  • Skinner designed a soundproof apparatus, often equipped with a lever or bar, with which he conducted his experiments in operant
    9·1 answer
  • Stephen needs to insert a field into a building block that will contain variable data. Which keyboard shortcut can he use to tog
    6·1 answer
  • Write a program that reads from user (i) an hour between 1 to 12 and (ii) number of hours ahead. The program should print the ti
    15·1 answer
  • Problem: you need to write a code that read 2 array of size 10x10 of zero and ones that represent black
    8·1 answer
  • What is python?????????
    11·1 answer
  • Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the array's
    5·1 answer
  • Which three IP addresses may be pinged by the Test Management Network feature in the ESXi hosts DCUI
    12·1 answer
  • Jacob was sitting in class. His teacher understands that he is the type of student that doesn't comprehend when he sees or hears
    6·1 answer
  • The Cisco ____ model does not describe how communications take place. Rather, it focuses on how best to design a network, especi
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!