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
What should you do if a reporter asks you about potentially classified information on the web
Natasha_Volkova [10]

Answer:

Neither confirm nor deny the information is classified.

Explanation:

This action is taken because if you answer that the information is classified, more questions will arise about why it is classified thus leaving you in an awkward situation to respond (since it is classified by something).

In the event that you answer that it is not classified, it also gives rise to the reason that the information is not of simple access also exposing you to answering more questions and having to release the confidential information.

By denying both confidentiality and non-confidentiality, you refer to ignorance of the subject by avoiding further questions about such information on the web.

5 0
3 years ago
Practicing touch typing allows you to create documents efficiently and accurately.
Marysya12 [62]
I think the answer to this would be true
8 0
3 years ago
What is a trojan horse in computer science?
Firdavs [7]

Answer:

type of malware that is often disguised as legitimate software. Trojans can be employed by cyber-thieves and hackers trying to gain access to users' systems. Users are typically tricked by some form of social engineering into loading and executing Trojans on their systems.

Explanation its malware

4 0
2 years ago
Pick the correct statements regarding cell references.
shusha [124]

Statement two and three is correct.

Statement 1 is incorrect. A relative reference changes when a formula is copied to another cell while Absolute references remain constant. However, it is safe to say that an absolute address can be preceded by a $ sign before both the row and the column values. It is designated by the addition of a dollar sign either before the column reference, the row reference, or both. Statement C is also correct. A mixed reference is a combination of relative and absolute reference and the formula (= A1 + $B$2) is an example of a mixed cell reference.

7 0
3 years ago
Read 2 more answers
you are a bank loan officer. carter has to come into your office and applied for a loan for a car.you ran his credit report, and
elena-14-01-66 [18.8K]

Answer:

Carter score falls within the range of scores, from 300 to 579, considered Very Poor. Score is significantly below the average credit score.

Explanation:

5 0
3 years ago
Other questions:
  • While working alone at their respective constant rates, computer X processes 240 files in 4 hours and computer Y processes 240 f
    11·1 answer
  • What can a parent do to help a child adjust to a new culture or area
    7·2 answers
  • When resizing images or objects in a presentation, why should a user not utilize the sizing handles in the middle of the sides
    5·2 answers
  • HELP PLEASE
    5·1 answer
  • Your program will demonstrate use of arrays, searching an array, using methods, passing parameters by reference, returning value
    13·1 answer
  • Write a function similar to keep_ints like before, but now it takes in a number n and returns a function that has one parameter
    8·1 answer
  • Which best describes obliteration in a forged document?
    11·1 answer
  • Compare the two items in a summary of qualifications taken from a resumé. Which is better?
    9·1 answer
  • In Outlook 2016, the Tell Me function can be accessed by
    15·2 answers
  • 13. In cell B16, use the SUMIF function and structured references to display the total wins for teams in the Youth league.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!