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
Many company websites are now designed to do more than just sell a product. These​ websites, known as​ __________ websites, atte
Zinaida [17]

Answer:

brand community

Explanation:

Many company websites are now designed to do more than just sell a product. These​ websites, known as​ brand community websites, attempt to build closer customer relationships and generate engagement with and between the brand and its customers. These online communities bring together consumers who have shared interests in a brand or product. One advantage of online brand communities is that they reduce customer support costs as the business has more engagement with their customers.This also helps the business to retain customers through brand improvement centered around the customer's actual needs.

5 0
3 years ago
In what way are a coffee maker and a dishwasher the same?<br><br>BY THE WAY THIS IS TEENBIZ
weeeeeb [17]
They both need electricity. Both used in the kitchen.
3 0
3 years ago
Read 2 more answers
Assume there are 15 students registered for a history class. You will need to declare an array of the StudentType structure to c
andrezito [222]

Answer:

#include <iostream>

using namespace std;

struct StudentType{

   string studentName;

   int studentId;

}

int n;

char answer[20];

int main(){

   cout<< "Enter the size of the array: ";

   cin >> n;

   StudentType *student = new StudentType(n);

   for (int i = 0; i < n; i++){

       int name;

       int number;

       cin>> name;

       cin >> number;

       student[i].studentName = name;

       student[i].studentId = number;

   }

   for (int i = 0; i < 20; i++){

       cout<< "Enter answers: ";

       cin >> ans;

       answer[i] = ans;

   }

}

Explanation:

The C++ source code has three global variables namely, answer which is an array of character data type, StudentType which is a structure data type and the integer variable n. The main function declares and initializes the dynamic-spaced student array of the structure datatype with the n variable.

3 0
3 years ago
Search syndication and distribution is when a search engine provides its services to a third-party in need of search capabilitie
iren [92.7K]
The answer is TRUE.  <span>Search syndication and distribution is when a search engine provides its services to a third-party in need of search capabilities for their digital properties. </span>
5 0
3 years ago
Oil refining is an example of:
morpeh [17]

Answer:

i think the answer is B but i could be wrong...

5 0
3 years ago
Other questions:
  • The United States is the only country in the world in which organs and tissue transplants are performed. True or False?
    8·1 answer
  • I need an answer and fast What happens if a sequence is out of order?
    5·2 answers
  • Catering question<br> What is the hottest food in the world
    5·1 answer
  • When evaluating the validity of a website beyond its URL, you can practice the "rule of 3" which means
    11·2 answers
  • 4.In order for a driver to graduate from a learner’s license to an operator’s license, how many hours of driving need to be docu
    15·1 answer
  • Janet received an email from a bank asking for the password for her Internet banking account. She emailed back her password. A f
    12·2 answers
  • Which of the following is NOT a valid name for a function?
    5·1 answer
  • The first mechanical computer design in by Charles Babbage was Called​
    5·2 answers
  • I don’t understand this, i need help
    7·1 answer
  • Computer that process digital as well as analogue signals​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!