Create a Java program that combines for
, while
, and do-while
loops to solve the following problem:
- Prompt the user to enter a series of numbers (at least 5 numbers).
- Use a
do-while
loop to ensure at least 5 numbers are entered. - Use a
for
loop to calculate the sum of the entered numbers. - Use a
while
loop to find the maximum number in the series.
Constraints:
- Ensure the program handles invalid input gracefully.
- The program should output the sum and the maximum number.