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
spin [16.1K]
3 years ago
13

Write a method called min that takes three integers as parameters and returns the smallest of the three values, such that a call

of min(3, -2, 7) would return -2, and a call of min(19, 27, 6) would return 6. Use Math.min to write your solution.
Computers and Technology
1 answer:
Debora [2.8K]3 years ago
7 0

Answer:

public class Main

{

public static void main(String[] args) {

 System.out.println(min(3, -2, 7));

}

public static int min(int n1, int n2, int n3){

    int smallest = Math.min(Math.min(n1, n2), n3);

    return smallest;

}

}

Explanation:

*The code is in Java.

Create a method named min that takes three parameters, n1, n2, and n3

Inside the method:

Call the method Math.min() to find the smallest among n1 and n2. Then, pass the result of this method to Math.min() again with n3 to find the min among three of them and return it. Note that Math.min() returns the smallest number among two parameters.

In the main:

Call the method with parameters given in the example and print the result

You might be interested in
Employees don't have to comply with PPE requirements if they feel the PPE isn't necessary for the particular task they performed
ANTONII [103]
You know what...ITS IS VERY VERY FREAKIN FALSE!!
7 0
3 years ago
Read 2 more answers
PLZ HELP!! How does HTML help solve the problem of telling a computer what a web page looks like, not just the content that is o
Anastasy [175]

Answer:

HTML is a code language. computers understand things in different ways because of the different languages that people use in code..(java, C++, HTML, etc.) Thus, if you understand the coding of HTML, that means you should be able to add things to your website anytime you want. you can even have links to other sites that are designed the same way, giving the illusion of rooms in a website I guess... If a website has links, you can have more information without storing it on the main paige and cluttering everything up together...

I hope this answered your question.

8 0
3 years ago
A ________ allows a hacker to gain access to your computer and take almost complete control of it without your knowledge. zombie
lozanna [386]
<span>A rootkit allows a hacker to gain privileged or 'root' access to a computer. A rootkit is designed to actively hide its presence so that the attacker can continue having full access for as long as they need to carry out their intended malicious actions without being detected.</span>
6 0
4 years ago
Write code that prints: Ready! numVal ... 2 1 Go! Your code should contain a for loop. Print a newline after each number and aft
DaniilM [7]

Answer:

public class ForLoops {

   public static void main (String [] args) {

       int countNum;

       int i;  

       countNum = 3;  

       System.out.println("Ready!");

       for(i = countNum;i>0;i--) {

           System.out.println(i);

       }

       System.out.println("Go!");

   }

}  

Output:

8 0
3 years ago
What are 3 websites that talk about density of different gases, density in air, behavior of different gases of earth, convection
Tanzania [10]
I don’t know if this supports all, but try lenntech, duckters, and I will add on later
6 0
3 years ago
Other questions:
  • ___________ is a mass-produced, copyrighted software that meets the needs of a wide variety of users, not just a single user or
    15·1 answer
  • Create a lottery game application. Generate three random numbers (see Appendix D for help in doing so), each between 0 and 9. Al
    14·1 answer
  • Which device can be installed on the edge of your network to allow multiple remote users to connect securely to your internal en
    9·1 answer
  • Big data: options:
    8·1 answer
  • How is a geometric constraint different from a numeric constraint?
    12·1 answer
  • COMPUTER FUNDIMENTAL HELP 20 POINTS!!!
    5·1 answer
  • Technician A says that almost every part of a vehicle is somehow powered by or controlled by an electrical or electronic system.
    9·2 answers
  • Multiple Choice
    7·1 answer
  • Is anyone a robIox moderator?
    13·2 answers
  • Write pseudo code that performs the following: Ask a user to enter a number. If the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!