Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started