[Solved] CS_1C Homework 13-Exceptions

$25

File Name: CS_1C_Homework_13_Exceptions.zip
File Size: 263.76 KB

SKU: [Solved] CS_1C Homework 13-Exceptions Category: Tag:
5/5 - (1 vote)

using HW12

  1. Test the assert macro (both pass and fail); print a corresponding output statement.
  2. Add exceptions to the queue template.
    1. Throw an exception if the capacity is exceeded. Print an appropriate error message in the associated exception handler.
    2. Throw an exception if your program tries to remove from an empty queue. Print an appropriate error message in the associated exception handler.
    3. 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

cs1c@cs1c-VirtualBox ~/cs1c/hw/13 $ script hw13.scr Script started, file is hw13.scr cs1c@cs1c-VirtualBox ~/cs1c/hw/13 $ date

cs1c@cs1c-VirtualBox ~/cs1c/hw/13 $ ls -l

cs1c@cs1c-VirtualBox ~/cs1c/hw/13 $ make all

cs1c@cs1c-VirtualBox ~/cs1c/hw/13 $ ls -l

cs1c@cs1c-VirtualBox ~/cs1c/hw/13 $ ./hw13

HW13 Exceptions [50 pts]

// print output from steps 1 and 2 above

cs1c@cs1c-VirtualBox ~/cs1c/hw/13 $ exit Script done, file is hw13.scr

cs1c@cs1c-VirtualBox ~/cs1c/hw/13 $ make tar

Shopping Cart

No products in the cart.

No products in the cart.

[Solved] CS_1C Homework 13-Exceptions
$25