Find the best answers to your questions with the help of IDNLearn.com's expert contributors. Ask your questions and receive reliable and comprehensive answers from our dedicated community of professionals.

(problem is given by the image)

Problem Is Given By The Image class=

Sagot :

The program that prompts the user for three integers and displays their average as a floating point is given below:

The Code:

import java.util.Scanner;

public class ArithmeticSmallestLargest {

   public static void main(String[] args) {

       Scanner input = new Scanner(System.in);

       int num1;

       int num2;

       int num3;

       int sum;

       int average;

       int product;

       int largest;

       int smallest;

       System.out.print("Enter First Integer: ");

       num1 = input.nextInt();

       System.out.print("Enter Second Integer: ");

       num2 = input.nextInt();

       System.out.print("Enter Third Integer: ");

       num3 = input.nextInt();

       sum = num1 + num2 + num3;

       average = sum / 3;

       product = num1 * num2 * num3;

       largest = num1;

       smallest = num1;

       if(num2 > largest)

           largest = num2;

       if(num3 > largest)

           largest = num3;

       if(num2 < smallest)

           smallest = num2;

       if (num3 < smallest)

           smallest = num3;

       System.out.println("The sum is " + sum);

       System.out.println("The average is " + average);

       System.out.println("The product is " + product);

       System.out.println("Largest of three integers is " + largest + " and the smallest is "+ smallest + ".");

   }

}

Read more about java programming here:

https://brainly.com/question/18554491

#SPJ1

Thank you for participating in our discussion. We value every contribution. Keep sharing knowledge and helping others find the answers they need. Let's create a dynamic and informative learning environment together. Thank you for trusting IDNLearn.com with your questions. Visit us again for clear, concise, and accurate answers.