Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program that prompts the user to enter three integers from the keyboard, one at a time. The program then outputs the larger

Write a Java program that prompts the user to enter three integers from the keyboard, one at a time. The program then outputs the larger of the first and second integers entered, unless the third integer entered is even, in which case the program outputs the smaller of the first two integers. However, if the first two integers entered are the same, the program outputs the product of the three integers, regardless of whether the third integer is even or odd. Here are several sample runs:

Enter an integer: 13

Enter an integer: 42

Enter an integer: 101

Output: 42

-------------------------------------------------------

Enter an integer: 13

Enter an integer: 7

Enter an integer: 5

Output: 13

-------------------------------------------------------

Enter an integer: 50

Enter an integer: 70

Enter an integer: 6

Output: 50

-------------------------------------------------------

Enter an integer: 1000

Enter an integer: 600

Enter an integer: 88

Output: 600

-------------------------------------------------------

Enter an integer: 10

Enter an integer: 10

Enter an integer: 9

Output: 900

-------------------------------------------------------

Enter an integer: 5

Enter an integer: 5

Enter an integer: 10

Output: 250

-------------------------------------------------------

public static void main(String [] args) {

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions

Question

Did the team members feel that their work mattered

Answered: 1 week ago

Question

3. What may be the goal of the team?

Answered: 1 week ago