Question: [JAVA} Thanks in advance for your help! Write a program that asks the user to type in ages. They will type a negative age when

[JAVA} Thanks in advance for your help!

Write a program that asks the user to type in ages. They will type a negative age when they finish entering the ages. The program will print out the average of all of the ages and the oldest age entered. It should end with a newline.

Sample output #1

Type a negative for age to exit Enter your age: 21 Enter your age: 22 Enter your age: 21 Enter your age: -8 The average age is: 21.33 The oldest person is: 22 years old 

Sample output #2

Type a negative for age to exit Enter your age: -10 No ages were entered

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!