using HW12
- Test the assert macro (both pass and fail); print a corresponding output statement.
- Add exceptions to the queue template.
- Throw an exception if the capacity is exceeded. Print an appropriate error message in the associated exception handler.
- Throw an exception if your program tries to remove from an empty queue. Print an appropriate error message in the associated exception handler.
- Test both exceptions
Following an exception, the program should allow one to recover from a mistake without corrupting the contents of the queue.
Use the command script to capture your interaction compiling and running the program, including all operations, as shown below:
CS1C Fall 2018 TTH HW13 50pts Due: Fri 11/16/2018
[email protected] ~/cs1c/hw/13 $ script hw13.scr Script started, file is hw13.scr [email protected] ~/cs1c/hw/13 $ date
[email protected] ~/cs1c/hw/13 $ ls -l
[email protected] ~/cs1c/hw/13 $ make all
[email protected] ~/cs1c/hw/13 $ ls -l
[email protected] ~/cs1c/hw/13 $ ./hw13
HW13 Exceptions [50 pts]
// print output from steps 1 and 2 above
[email protected] ~/cs1c/hw/13 $ exit Script done, file is hw13.scr
[email protected] ~/cs1c/hw/13 $ make tar
Reviews
There are no reviews yet.