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 of the following is NOT true about mobile app development:
Arte-miy333 [17]

Answer:

The answer is C.

Explanation:

Websites are far quicker to develop than apps.

7 0
3 years ago
A wiki is best defined as:
Basile [38]

Answer:

a reverse chronological journaling site. a user-collaborated content site, typically text in nature

Explanation:

It is the website that is based on knowledge. It is the text based site that is also called structure content.

The most common example of Wiki is Wikipedia.

8 0
3 years ago
An investigator responsible for tracking e-mail communication would begin by locating what
Ainat [17]
Email headers contains information about email
6 0
3 years ago
Which of the following is not a method of the history object?
Volgvan

Answer:

replace()

Explanation:

The history object in javascript corresponds to browsing history.

It has the following methods for navigating through the history list:

back(): Go back in the history list

forward(): Go forward in the history list

go() : Navigate to the currently pointed url in the history list. It takes a parameter which can either be a numeric index or a string which is matched with the history list content.

replace() is not a method in the history object.

7 0
3 years ago
FIRST PERSON TO FINISH GETS BRAINLIST
ivanzaharov [21]
1. D

2. D

3. ?

4. False

5. True

3 0
3 years ago
Other questions:
  • 6. An art museum owns a large volume of works of art. Each work of art is described by an item code (identifier), title, type, a
    6·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
  • 5. Which of the following could occur making it necessary for Amy to troubleshoot her computer? Error messages keep popping up,
    12·1 answer
  • The relational database is the primary method for organizing and maintaining data today in information systems. It organizes dat
    9·1 answer
  • Retraining is required at intervals of ___ or less.
    10·1 answer
  • What are the basic tasks performed by an operating system?​
    5·1 answer
  • Describe the steps to change an existing macro in Microsoft office 2016
    6·1 answer
  • 2 differences between system and applications software​
    9·2 answers
  • What dose a compress pictures command do ?
    14·1 answer
  • What feature should you enable to prevent the sidhistory attribute from being used to falsely gain administrative privileges in
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!