(Solved):Write a program that calculates the average of N integers. The program should prompt the user to enter the value for N and then all N numbers. Use an array to save the N integers. If the user enter… View Answer…

 

Question

Write a program that calculates the average of N integers. The program should prompt the user to enter the value for N and then all N numbers. Use an array to save the N integers. If the user enters a nonpositive value for N, an exception should be thrown (and caught) with the message “N must be positive.” If there is any exception as the user is entering the N

Scroll to top