Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java Write a program that finds the average of three integers: evenNum 1 , evenNum 2 , and oddNum. As you might have guessed,

in java Write a program that finds the average of three integers: evenNum1, evenNum2, and oddNum. As you
might have guessed, make two of the integers even numbers, and one an odd number.
Have your program:
1. Prompt the user for an even number; store the number in evenNum1.
2. Prompt the user for another even number; store the number in evenNum2.
3. Prompt the user for an odd number; store the number in oddNum.
4. Calculate the sum of the three numbers and save result in an integer variable called sum.
5. Use sum to calculate the average of the three numbers and store the result in an integer
variable called avg.
6. Output the phrase:
The average of evenNum1, evenNum2, and oddNum, is avg.

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

Students also viewed these Databases questions

Question

Prepare a short profile of Henry words worth Longfellow?

Answered: 1 week ago

Question

What is RAM as far as telecommunication is concerned?

Answered: 1 week ago

Question

Question 1: What is reproductive system? Question 2: What is Semen?

Answered: 1 week ago