CSC 172 - Introduction to Algorithms and Data Structures

Dr. R. M. Siegfried

Assignment #11 - Finding the Average of n non-negative numbers

Due Monday, April 7, 2014

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]