Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a program in Java with the following requirements: Using a Scanner and print statements, ask the user to input 3 numbers. Use Javas int

Create a program in Java with the following requirements:

  • Using a Scanner and print statements, ask the user to input 3 numbers. Use Javas int data typedont worry about error checking for this assignment (assume the user doesnt try to break your program)
  • Store these three numbers into three variables
  • Calculate the sum of all three numbers
  • Calculate the product of all three numbers
  • If all three numbers are even, output Lucky Duck!
  • If all three numbers are odd, output How Odd!
  • Output the largest of the three numbers

Example of a result:

enter the first number: 2

enter the second number: 8

enter the third number: 6

sum is 16

product is 96

Lucky Duck!

largest is 8

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

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

=+2. Explain the interactions in the newspaper and magazine market!

Answered: 1 week ago