Step-by-step Instant Solution
Write a program that calculates the average ofNintegers. The program should prompt the user to enter the value forNand then afterward must enter allNnumbers. If the user enters a nonpositive value forN, then an exception should be thrown (and caught) with the message ?Nmust be positive.? If there is any exception as the user is entering theNnumbers, an error message should be displayed, and the user prompted to enter the number again.
Paper#9255659 | Written in 27-Jul-2016Price : $16