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
The non-conditional boolean logical and operator is written as ____.
bixtya [17]
False because whhy would it be true. words of logic

3 0
3 years ago
Please describe in a few sentences
myrzilka [38]

Because a theorie is someones scientific quess on a matter so soon they get a understanding and change them. They are not discarded because they usually keep the same wording but not all so that it is correct then.

:)

4 0
3 years ago
The layout gallery displays 10 slide layouts with a variety of placeholders to define text and content positioning and formattin
Papessa [141]
The above statement is FALSE.

The layout gallery displays 9 slide layouts NOT 10. 

These 9 layouts have various<span> placeholders to define text and content positioning and formatting.

</span>1 - Title slide
2 - Title and content
3 - Section Header
4 - Two content
5 - Comparison
6 - Title only
7 - Blank 
8 - Content with Caption
9 - Picture with Caption
8 0
3 years ago
Which securities protects networks from intruders? *
timama [110]

Answer:

I think it is network security

Explanation:

Heard in an ad before :T

5 0
3 years ago
What are the use of simple machine​
Advocard [28]

Answer:

Simple machines are useful because they reduce effort or extend the ability of people to perform tasks beyond their normal capabilities. Simple machines that are widely used include the wheel and axle, pulley , inclined plane, screw, wedge and lever.

Explanation:

7 0
3 years ago
Other questions:
  • GUIs provide all of the following except _____.. a.command prompts. b.desktops. c.icons. d.menus
    5·2 answers
  • in python Write a loop that counts the number of lowercase characters that appear in the string referenced by mystring.
    11·1 answer
  • Finish the program to compute how many gallons of paint are needed to cover the given square feet of walls. Assume 1 gallon can
    9·1 answer
  • Is it true or false and incomplete doing can be saved in Paint​
    15·1 answer
  • What is the difference between MAC address and IP address?<br> Thanks in advance
    6·1 answer
  • Iam trying to find a way to code in Scratch that will let me take away the first two and last two letters of a word. For example
    15·1 answer
  • Click print to publish your post in a blog true or false.​
    5·2 answers
  • In which situation would Accenture apply principles of Responsible Artificial Intelligence (AI)?
    9·1 answer
  • What is precipitation ????
    5·2 answers
  • Which of the following factors is least likely to result in delivery delays?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!