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
Minchanka [31]
4 years ago
12

Write an application that solicits and inputs three integers from the user and then displays the sum, average, product, smallest

, and largest of the three numbers. You may use any Java input and output method you want, for example the JOptionPane class or the Scanner class.
Computers and Technology
1 answer:
Oksana_A [137]4 years ago
3 0

Answer:

Please find below program

Explanation:

import java.util.Scanner;

public class Tester {

public static void main(String[] args) {

 

 // create an object of scanner class

 Scanner scanner  = new Scanner(System.in);

 

 //prompt user to enter first number

 System.out.println("Enter first integer: ");

 

 // read value from entered by user and keep it in num1

 int num1 = scanner.nextInt();

 

 //prompt user to enter second number

 System.out.println("Enter second integer: ");

 

 // read value from entered by user and keep it in num2

 int num2 = scanner.nextInt();

 

 //prompt user to enter third number

 System.out.println("Enter third integer: ");

 

 // read value from entered by user and keep it in num3

 int num3 = scanner.nextInt();

 //close scanner as we have done with user input

 scanner.close();

 

 //calculate sum

 int sum = num1+num2+num3;

 

 //calculate average

 int average = sum/3;

 

 //calculate product

 int product = num1*num2*num3;

 

 //find out largest number

 int largest = 0;

 if (num1>=num2){

  if(num1>=num3)

   largest = num1;

  else

   largest = num3;

 }else {

  if(num2>=num3)

   largest = num2;

  else

   largest = num3;

 }

 

 // find out smallest number

 int smallest = 0;

 if (num1<=num2){

  if(num1<=num3)

   smallest = num1;

  else

   smallest = num3;

 }else {

  if(num2<=num3)

   smallest = num2;

  else

   smallest = num3;

 }

 

 // print all the information

 System.out.println("Sum of three numbers : "+sum);

 System.out.println("Product of three numbers : "+product);

 System.out.println("Average of three numbers : "+average);

 System.out.println("Smallest number : "+smallest);

 System.out.println("Largest number : "+largest);

}

}

You might be interested in
MULTIPLE CHOICE!!!
kolbaska11 [484]
The answer is a) you
8 0
4 years ago
Read 2 more answers
While Joe's wife Molly and daughter Sunny did not mind moving,his son Daniel was not too happy with the sudden change in their l
Ann [662]

It means your stupid look it up!!

6 0
3 years ago
Calculate the cash used to retire debt for each of the six months. Since the company can't pay down more debt than there is cash
BabaBlast [244]

Answer:

The required cash used to retire a debt can be computed as follows:

Cash used to retire debt = cash available to retire a debt, if the cash available to retire debt is less than the loan balance from previous month. Otherwise, cash used to retire debt is equal to the loan balance from previous month.

The excel formula to perform this task is provided as follows:

D33 = IF(D32<C34,D32,C34)

The same formula is used to get the values for E33 to I33.

Explanation:

See the attached picture for table.

5 0
3 years ago
The order of precedence determine
Free_Kalibri [48]
The order of precedence is the hierarchical order in which calculations are conducted. The simplest example of this is the way you always multiply before you add numbers.
7 0
4 years ago
Many Java programs that you create will receive and process user input. In order to ensure that user input is accurate, you will
Furkat [3]

Answer: True

Explanation: True

4 0
3 years ago
Other questions:
  • What is the rarest/coolest/most valuable car you have ever seen in person?
    6·2 answers
  • When working with a table, combining two or more cells into one is known as _____.
    12·1 answer
  • An example of a historical challenge of STAMIS is
    13·2 answers
  • Which of the actions below will not create more room on your hard drive?
    13·1 answer
  • Why do designers use tonal shading?
    10·2 answers
  • True / False You should always consider your business requirements before deciding which designs are best for your environment.
    13·1 answer
  • Write a program which will enter information relating to a speeding violation and then compute the amount of the speeding ticket
    14·1 answer
  • A data table is a range that displays what?
    15·2 answers
  • tiny electrical paths to connect everything together is called ? A. graphic card B. audio card C. CPU D. Motherboard
    6·1 answer
  • Which statement best characterizes under what circumstances you should add your social media profile to a resume? You should add
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!