Question: Program #2: Write a Java program that performs the following tasks: - Allows user to input three integers from keyboard. -If all three integers are

Program #2: Write a Java program that performs the following tasks:

- Allows user to input three integers from keyboard. -If all three integers are positive, program calculates and displays:

---Sum of the three integers. ---Product of the three integers.

---If not all three integers are positive and the first integer is greater than the third, program calculates and displays: ----Product of first and third; then subtracts the second from this product. ----Otherwise program calculates and displays the sum of the squares of the three integers.

In coding, make effective use of ifelse ifelse statements.

The numbers input are integers; they may be positive, negative, zero or any combination of these; this is up to the user on any run of the program. Be sure your program works no matter what the sign of the integers input.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!