Starting from:

$30

CS1C-Homework 13 Exceptions Solved

1.    Test the assert macro (both pass and fail); print a corresponding output statement.

2.   Add exceptions to the queue template.  

a.   Throw an exception if the capacity is exceeded. Print an appropriate error message in the associated exception handler.

b.   Throw an exception if your program tries to remove from an empty queue. Print an appropriate error message in the associated exception handler.

c.   Test both exceptions

 

Following an exception, the program should allow one to recover from a mistake without corrupting the contents of the queue. 

More products