Ask Question

numbers that the user inputs. You must use JoptionPane to input the three numbers. A first method must be called and used to develop logic to find the smallest of the three numbers. A second method must be used to print out that smallest number found.

+3
Answers (1)
  1. 7 August, 21:04
    0
    Input the three numbers. A first method must be called and used to develop logic to find the smallest of the three numbers. A second method must be used to print out that smallest number found.

    Explanation:

    Input of 3 numbers. Then the numbers are checked to print the smallest one.

    import java. util. Scanner;

    public class Exercise1 {

    public static void main (String[] args)

    {

    Scanner in = new Scanner (System. in);

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

    double x = in. nextDouble ();

    System. out. print ("Input the Second number: ");

    double y = in. nextDouble ();

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

    double z = in. nextDouble ();

    System. out. print ("The smallest value is " + smallest (x, y, z) + "/n");

    }

    public static double smallest (double x, double y, double z)

    {

    return Math. min (Math. min (x, y), z);

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “numbers that the user inputs. You must use JoptionPane to input the three numbers. A first method must be called and used to develop logic ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers