Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 535 Bytes

MixedLoop.md

File metadata and controls

11 lines (9 loc) · 535 Bytes

Problem 5: Mixed Loop Challenge

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.