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
Lera25 [3.4K]
4 years ago
13

numbers that the user inputs. You must use JoptionPane to input the three numbers. A first method must be called and used to dev

elop logic to find the smallest of the three numbers. A second method must be used to print out that smallest number found.
Computers and Technology
1 answer:
Inga [223]4 years ago
5 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);

   }

}

You might be interested in
In spreadsheets, a cell reference is also referred to as which of the following? A. active cell B. axis C. cell address D. entry
nignag [31]
Generally its referring to the cells location, so C.
4 0
3 years ago
Write a static method named evenNumbers that accepts a string of text as a parameter. Assume that the text is a series of intege
Allisa [31]

Answer:

// Program is written in Java Programming Language

// Comments are used for explanatory purpose

// Import input/output and utility libraries

import java.io.*;

import java.util.*;

Declare class/

public class Numbers {

// Main method goes here

public static void main(String[] args) throws FileNotFoundException

{

// Read input from text file evenFile.txt; Assume file name is evenFile.txt

Scanner input = new Scanner(new File("evenFile.txt"));

// Call static method here

evenNumbers(input);

}

// Static method evenNumbers begins here

public static void evenNumbers(Scanner input)

{

// Declare and initialise Variables

String Nums = input.nextLine(); // Read all number in txt file

Scanner numbers = new Scanner (Nums);

int count = 0; // Number count

int evens = 0; // Even count

int sum = 0; // Summation of numbers

// Check if number is integer. If yes, continue the below operations

while (numbers.hasNextInt())

{

int num = numbers.nextInt();

count++;

sum = sum + num;

if(num % 2 == 0) // check for even

{

evens++;

}

}

System.out.println("Total numbers= " + count); // Print total number

System.out.println("Sum of numbers = " + sum); // Print summation of numbers

System.out.println("Total evens = " + evens); // Print total even

//Calculate and print percentage of even number

double percent = ((double)evens/count)*100.0);

System.out.println("Percent of even number = " +percent);

}

}

// End of program

8 0
3 years ago
Read 2 more answers
Where would you go to access frequently used icons?
trapecia [35]

Answer:

b

Explanation:

4 0
3 years ago
Read 2 more answers
In one to two sentences, describe how you would insert a row in a spreadsheet.
Over [174]

Answer:

give points pls

Explanation:

7 0
4 years ago
Read 2 more answers
Data collected before an attorney issues a memo for an attorney-client privilege case is protected under the confidential work p
Shalnov [3]

Answer:False

Explanation: Attorney-client previlege is a rule that protects the confidentiality of the communication between the clients and the lawyer(attorney). This rule is put in place to encourage clients to communicate freely and give out adequate and necessary information in order for the Attorney to effectively handle the case. ANY DATA COLLECTED BEFORE THE ATTORNEY ISSUES A MEMO FOR AN ATTORNEY-CLIENT PRIVILEGE CASE IS NOT PROTECTED UNDER THE CONFIDENTIAL WORK PRODUCT RULE WHICH GUARANTEES THAT NO INFORMATION AFTER THAT MEMO SHALL BE DIVULGED WITHOUT APPROPRIATE CONSIDERATIONS.

7 0
4 years ago
Read 2 more answers
Other questions:
  • Most Answers MOST ANSWERS
    11·2 answers
  • Which result would support the particle theory of light?
    6·2 answers
  • What type of accessory device can be used to measure AC current with a VOM without opening the circuit? A. Split inductor B. Amp
    13·1 answer
  • How do i change my Email in brainly ? ​
    7·2 answers
  • The steps for moving data from one cell to another are _____.
    14·1 answer
  • A company has a main office and 12 branch offices. The users and computers are within a single domain. All servers are Windows S
    14·1 answer
  • Top Down Design makes it easier to solve a problem by:___________
    10·1 answer
  • How has the dependence on technology made humanity less intelligent?​
    15·1 answer
  • Describe what a Bank Run is.
    10·1 answer
  • Which of these describes a database? Check all of the boxes that apply.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!