CSC 175 - Intermediate Programming

Dr. R. M. Siegfried

Assignment #19 - Finding the average of non-negative numbers

Due Friday, April 10, 2024

Write a program that will ask the user for the number of values to be averaged. Then it will allow the user to enter that number of non-negative values . If the user enters a negative value, handle it by throwing a NegativeNumberException .

This will require to write a subclass of Exception called NegativeNumberException , which will need its own constructors.

[Back to the Assignments List]