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
In photoshop what should you consider when determining a projects purpose and objectives?
Darina [25.2K]

Answer:

Identify the purpose, audience, and audience needs for preparing image,Identify three phases that might appear in a project plan. When planning your design project you might include on an outline the goals.

4 0
2 years ago
How many possible keys does the playfair cipher have? an approximate power of 2
Lorico [155]
I don't know but I am guessing 666 or 777 or 888.
7 0
2 years ago
Is the Internet dangerous?
VARVARA [1.3K]

Many people would answer this in many different ways. In my personal opinion, it's a yes. It's a yes because it makes it easier for people to track you down (finding your iep) and it's easy for someone to take your identity. It's also dangerous for children and teens (even young adults) because there are many people wanting them, and wanting to meet them in public and things like that. I hope I answered your question! (:

8 0
2 years ago
Read 2 more answers
12. What are the additional elements required of a network architecture if the enclave is to support remote access through the p
Romashka [77]

The additional elements needed of a network architecture are:

  • Policy management
  • Remote access server
  • VPN Gateway, etc.

<h3>What is network architecture example?</h3>

Network architecture is known to be the set up of a computer network. It is regarded as the backbone for the specification of the physical attributes of a network and also their functional configuration.

An examples is a printer that is linked to the network. Note that  additional elements required of a network architecture if the enclave is to support remote access through the public Internet are Policy management, etc.

Learn more about network architecture from

brainly.com/question/13986781

6 0
2 years ago
Write a python program that will accept monthly salary amounts greater than zero but less
Naily [24]

Answer:

b=0

c=0

lol=list()

while True:

   salary=input("Enter your salary: ")

   if salary=="e" or salary=="E":

       print("Thankyou!!")

       break

   else:

       a=int(salary)

       if a>=300000 and a<=400000:

            c=c+1

       if a<0 or a>400000:

           print("Your salary is either too small or too big ")

       if a>0 and a<=400000:

           a=a-(25/100*a)-(5/100*a)-(2/100*a)

           lol.append(a)

           b=b+1

           if a>=300000:

                c=c+1

print(lol)

print("The number of salaries entered is: "+ str(b))

print("The number of salaries that exceeded 300000 is: "+str(c))

3 0
3 years ago
Other questions:
  • What is the preferred procedure for putting customers on hold​
    13·2 answers
  • "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequen
    5·2 answers
  • Florida Highway Safety and Motor Vehicles reported blank of traffic fatalities were alcohol-related in Florida in 2009.​
    8·1 answer
  • Many mobile devices can perform Internet searches and other tasks via
    8·1 answer
  • When was kale discovered?
    9·1 answer
  • What are examples of templates the Input Mask Wizard offers? Check all that apply.
    12·2 answers
  • Lesson 2.7 Code Practice #2
    13·1 answer
  • Define computers software.dicuss the types of computer software​
    5·1 answer
  • _____ are fields that are used to personalize a mail merge document
    9·1 answer
  • An opening inside the system unit in which you can install additional equipment can be known as
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!