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
Computer science - algorithms - flowcharts
Katarina [22]

bubble sort i dont now ok you are big mental

8 0
3 years ago
"background" software that helps the computer manage its own internal resources is called ________.
just olya [345]
"background" software that helps the computer manage its own internal resources is called system software. It is a software (<span> programs) that work in the background to provide basis for other software. Programs that are dedicated to managing the computer itself,  </span>the operating system<span>, file management utilities, and disk </span>operating system<span> (or DOS). </span>
4 0
3 years ago
What does this mean? And how did I get it?
Oliga [24]
If you’re talking about the rank then it just means your ambitious i guess and you got it by answering peoples questions
3 0
2 years ago
Read 2 more answers
In bankruptcy, most of a debtor’s assets will probably be used to repay unsecured debt
Juli2301 [7.4K]
This is true. A person in debt could have everything from their home to vehicles to even boats and other possessions taken in order to make up for the money owed. 
5 0
3 years ago
This is a tableware use to serve the main dish
GuDViN [60]

Answer:

<em>Dinner plate is a type of plate used for main courses. The average dinner plate measures 11 or 12 inches across. This plate is the most used plate during the entire meal and it usually comes out after the salad, it is the plate resting just above the charger.</em>

6 0
2 years ago
Other questions:
  • What is the purpose of a scatter plot introduction to computer applications
    6·2 answers
  • Why is e-mail better for informative and positive messages than for negative ones?
    6·1 answer
  • You can avoid culture shock by ____________.
    10·2 answers
  • What is the fastest way to locate a record for updating?
    6·1 answer
  • python A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun
    15·2 answers
  • which of the following statements about matter is true a.matter is anything that occupies space and possesses mass b.matter can
    5·2 answers
  • Your windows system is used by several people, so you want increase security by requiring users to create passwords that are at
    9·1 answer
  • Write a program that dose the following:
    9·1 answer
  • . Write at least three benefits of using a network.​
    8·1 answer
  • Whats the flow in this code, and whats the risk that its creating and what can i do to fix it? (c language)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!