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
Leno4ka [110]
3 years ago
10

Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the t

hree values. If the input is 7 15 3, the output is: largest: 15 smallest: 3 Your program should define and call two functions: Function LargestNumber(integer num1, integer num2, integer num3) returns integer largestNum Function SmallestNumber(integer num1, integer num2, integer num3) returns integer smallestNum The function LargestNumber should return the largest number of the three input values. The function SmallestNumber should return the smallest number of the three input values.
Computers and Technology
1 answer:
arlik [135]3 years ago
8 0

Answer:

import java.util.*;

public class Main

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

    System.out.print("Enter the first number: ");

    int n1 = input.nextInt();

    System.out.print("Enter the second number: ");

    int n2 = input.nextInt();

    System.out.print("Enter the third number: ");

    int n3 = input.nextInt();

 System.out.println("largest: " + LargestNumber(n1, n2, n3));

 System.out.println("smallest: " + SmallestNumber(n1, n2, n3));

}

public static int LargestNumber(int num1, int num2, int num3){

    int largestNum = 0;

    if(num1>=num2 && num1>=num3)

        largestNum = num1;

    else if(num2>=num1 && num2>=num3)

        largestNum = num2;

    else if(num3>=num1 && num3>=num2)

        largestNum = num3;

       

    return largestNum;

}

public static int SmallestNumber(int num1, int num2, int num3){

    int smallestNum = 0;

    if(num1<=num2 && num1<=num3)

        smallestNum = num1;

    else if(num2<=num1 && num2<=num3)

        smallestNum = num2;

    else if(num3<=num1 && num3<=num2)

        smallestNum = num3;

       

    return smallestNum;

}

}

Explanation:

Create function called LargestNumber that takes three parameters, num1, num2, num3. Find the largest number using if else structure among them and return it. For example, if num1 is both greater than or equal to num2 and num3, then it is the largest one.

Create function called SmallestNumber that takes three parameters, num1, num2, num3. Find the smallest number using if else structure among them and return it. For example, if num1 is both smaller than or equal to num2 and num3, then it is the smallest one.

Inside the main, ask the user for the inputs. Call the functions and print the largest and smallest.

You might be interested in
The following is an example of what kind of loop?
My name is Ann [436]
Step by step equation
5 0
3 years ago
Read 2 more answers
The user documents are stored in _______ format.
BartSMP [9]

The user documents are stored in _______ format.

A. qvd.

B.  qvw

C.  None of the options

D.  qvs.

Answer:

B.  qvw

Explanation:

Given the options available, it can be inferred that the application the question is referring to is called QlikView which is a software application that is used for analytics explanation. This software applications saves documents created in a file extension specifically known as "QVW."

Hence, the right answer is that: in QlikView, the user documents are stored in QVW format.

8 0
3 years ago
Lance is at a bus station. his friend is using the atm machine to withdraw some money. lance notices a stranger deceptively watc
stich3 [128]

The person watching Lances friend typing the ATM pin is an example of shoulder browsing. Lances friend should change the ATM pin.

<h3>What does ATM mean?</h3>

This is known as automated teller machine. It is said to be a kind of unique computer that makes it easy to manage a bank account holder's money.

Based on the above, The person watching Lances friend typing the ATM pin is an example of shoulder browsing. Lances friend should change the ATM pin so that his funds will not be stolen.

Learn more about ATM from

brainly.com/question/12629434

#SPJ4

4 0
2 years ago
Read 2 more answers
Floating point values (real numbers that can handle up to 5 decimals)
Ann [662]

Answer:

1.45638

Explanation:

p please mark me as brainlest

4 0
2 years ago
Which of the following statements is/are true by definition.
Rudik [331]

Answer:2. electrical equipment shall be considered readily accessible to those to whom ready access is requisite when it is capable of being reached quickly for operation by using a portable ladder.

Explanation:

3 0
3 years ago
Other questions:
  • Consider a relation representing the present position of molecules in a closed container. The attributes are the ID for the mole
    12·1 answer
  • The number of bits used to store color information about each pixel is called ____.
    13·1 answer
  • A disadvantage of using an arithmetic mean to summarize a set of data is that __________.
    13·1 answer
  • Original Problem statement from the Text: A retail company must file a monthly sales tax report listing the sales for the month
    7·1 answer
  • How can an Excel table be added to a Word document? Check all that apply.
    15·1 answer
  • Which of the following methods for learning to use new software includes tips for using the product, updates to download, and in
    7·2 answers
  • Suppose that the instruction format for a modified Little Man Computer requires two consecutive locations for each instruction.
    5·1 answer
  • WHATS YALL FAVORITE GAME WHOEVER GIVES THE BEST ANSWER WINS 200
    13·2 answers
  • Your company is building a new architecture to support its data-centric business focus. You are responsible for setting up the n
    15·1 answer
  • Is majority intent determined by how many times the same type of result is shown on the search engine result page?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!