Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 526 Bytes

e093.md

File metadata and controls

9 lines (7 loc) · 526 Bytes

Back to questions

e093: Average of numbers

Write a program that prompts the user to enter a positive integer n, then asks for n integers to be entered, and prints their average (computed as a double). If the user enters a non-integer at any point, you should detect this by catching a NumberFormatException, and display a message stating that this input has been ignored. If the user initially enters a non-positive integer, you should also detect this and request a positive integer instead.