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
Which activities below might have a negative effect on your online reputation?
Zepler [3.9K]

Answer:

I believe the last 2 maybe even the one above the second to last answer

Explanation:

3 0
3 years ago
Lonic compounds are also known as <br> a. salts <br> b. valence <br> c.organic <br> d.elements
shutvik [7]
I'm not quite sure but it maybe b
6 0
3 years ago
Read 2 more answers
What is a music composition copyright?
Anestetic [448]
For copyright<span> purposes, there is a difference between </span>MUSICAL<span> COMPOSITIONS and SOUND RECORDINGS. A </span>Musical Composition<span> consists of </span>music<span>, including any accompanying words, and is normally registered as a work of performing arts. The author of a </span>musical composition<span> is generally the composer and the lyricist, if any.</span>
3 0
3 years ago
Read 2 more answers
Trace the code below to find the two errors.
nasty-shy [4]

Answer:subtotal =.08

Explanation:

8 0
2 years ago
Which of the following was the most significant impact the NEA had on the performing arts industry? W
Sedaia [141]

Answer:

The NEA’s focus on building new performing arts centers led to an increased production of arts.

5 0
3 years ago
Other questions:
  • Which of the following are examples of algorithms? (Select all that apply, if any do.)
    15·2 answers
  • A user states that when they power on their computer, they receive a "Non-bootable drive" error. The user works with external st
    8·1 answer
  • Write a function SwapArrayEnds() that swaps the first and last elements of the function's array parameter. Ex: sortArray = {10,
    8·1 answer
  • Match each keyboard command with its result.
    6·1 answer
  • Write a program that prints the day number of the year, given the date in the form month-day-year. For example, if the input is
    9·1 answer
  • The area on your screen where you can access the tab and menu options for word is called what?
    8·2 answers
  • If you want to insert a column into an existing table, what would you do?
    13·2 answers
  • Enthusiasm codehs 7.6.4 Write a function called add_enthusiasm that takes a string and returns that string in all uppercase with
    15·1 answer
  • B) The company's chief financial officer recognizes the need for an upgrade to the smart watches, but does not understand why th
    8·1 answer
  • can you still receive messages on messenger from a person when you deleted the conversation with them? (But not blocked them)
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!