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
Jeffrey works with a huge database of spreadsheet records each day. To organize and identify these spreadsheets, he wants to ass
Reika [66]

Answer:

File details is the correct answer for PLATO users

8 0
2 years ago
Read 2 more answers
An information system interacts with its environment by: A. processing data. B. XML protocols. C. receiving data. D. systems ana
ASHA 777 [7]

Answer:

C. receiving data.

Explanation:

An information system interacts with its environment by receiving data in its raw forms and information in a usable format.

Information system can be defined as a set of components or computer systems, which is used to collect, store, and process data, as well as dissemination of information, knowledge, and distribution of digital products.

Generally, it is an integral part of human life because individuals, organizations, and institutions rely on information systems in order to perform their duties, functions or tasks and to manage their operations effectively. For example, all organizations make use of information systems for supply chain management, process financial accounts, manage their workforce, and as a marketing channels to reach their customers or potential customers.

Additionally, an information system comprises of five (5) main components;

1. Hardware.

2. Software.

3. Database.

4. Human resources.

5. Telecommunications.

<em>Hence, the information system relies on the data it receives from its environment, processes this data into formats that are usable by the end users. </em>

7 0
3 years ago
Which vendor did IBM select to create the operating system for the IBM PC?
schepotkina [342]
The Answer Is: "Microsoft".
7 0
3 years ago
A data analyst creates a data frame with data that has more than 50,000 observations in it. When they print their data frame, it
Alexandra [31]

A list is an R-object that can have a wide range of different items inside of it, including vectors, functions, and even another list.

The head() function lets you display the first observations in a data frame. The method tail() prints the final observations in your data collection in a manner similar to that. Both head() and tail() print a top line called the 'header', which contains the names of the distinct variables in your data collection. The R language's transform() function is used to alter data. The first parameter is transformed into a data frame. A suitable variable name comprises of letters, numbers and the dot or underline characters. The variable name does not begin with a number but rather with a letter or a dot.

Learn more about variable here-

brainly.com/question/13544580

#SPJ4

7 0
11 months ago
What is the purpose behind the Three Phase Commit? It improves upon the two phased commit by requiring that locks be acquired at
Ray Of Light [21]
The answer is a) It improves upon the two-phased commit by requiring that locks be acquired at the start of a transaction.

Reason: The 3PC is an extension or you can say developed from 2PC that avoids blocking of an operation. It just ensures that first n sites have intended to commit a transaction that means it acquires commits or locks before the start of any transaction to avoid any blocking.

Option b) is wrong as it does not allow coordination, it just let all the other sites do their transaction if any other site is blocked, so no coordination is there between sites that they will wait till their coordinator is corrected.

Option c) is wrong as lock operations are shared between other connections as when their coordinator fails, the new coordinator agrees to the old coordinator that they had shared locks before and they can start their transaction.

Option d) is wrong as option a) is correct.

If you like the answer, please upvote.
4 0
2 years ago
Other questions:
  • Sahil is making a graphic novel in which the villain plans to reduce the rate at which energy is released from the Sun. The vill
    7·2 answers
  • On a Linux system, which command allows you to modify settings used by the built-in packet filtering firewall?
    15·1 answer
  • Desmond must enter a long string of numbers (1 4 9 2 1 6 2 0 1 7 7 6) into an old computer every two hours or the computer will
    12·1 answer
  • When performing conflict management, it is important to identify your;
    6·1 answer
  • Help me out with this .....
    10·1 answer
  • ___MSDS provides information on how to handle, store, discard and care for potentially hazardous chemicals. true or false?​
    5·1 answer
  • How do I modify objects in power point 2016 for an assignment
    11·1 answer
  • Electronic mail is a
    9·1 answer
  • Why are mobile apps often easier to develop than desktop apps?
    11·1 answer
  • Write the features of Mark-I.​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!