CS 405 Module Three Exception Handling Activity Guidelines and Rubric
Overview: Part of secure coding is a programmerâ€™s ability to add error-handling code to test for out-of-the-ordinary anomalies (dividing by zero). It is an essential skill for any programmer to ensure their code tests for any exceptional circumstance that occurs. Exceptions are usually very general and cover a broad category of things that might go wrong. Exceptions also allow us to customize and more precisely indicate a problem. To throw an exception, we will need to use the keyword throw. Here is the format: â€˜throw ExceptionType(arguments);â€™. Refer to this Exception Specifications webpage for more information on using the throw function. Another method of checking risky code that may throw an exception is the try-catch block. The throw function ends a program when an exception is found, but with the try-catch method, if the risky code has an exception, we can define what to do in the catch block. Review Errors and Exception Handling (Modern C++) for more information on using a try-catch block.
To complete this assignment, download the Module Three Activity Source Code Files and use the Module Three Exception Handling Activity Instructions for guidance as you move through the activity. You will use your development environment to complete this activity. Create another project in Eclipse for this activity and import your source code files into that project and then the follow the instructions to complete this activity.
Prompt: This assignment presents code that needs to use exceptions to catch anomalies that could otherwise go unchecked. Use the existing source code to uncomment and finish the try-catch statements. The source code includes a stack-exception class that can be used to customize exceptions in the code. Include a brief written summary of the process you used, the issues you found, and how you corrected the issues. After you follow the instructions, you will only need to submit the stack.cpp source code file.
The following critical elements should be addressed in your project submission:
ï‚· Uncomment and fix the exception statements found in the code. ï‚· Follow the instructions and hints at the beginning of each file to fix the code to use the exceptions. ï‚· Utilize the stack-exception class to create custom exception statements. ï‚· Provide a summary of the debugging process that is thorough and systematic. Include specific types of bugs you found and the corrections you made.
Guidelines for Submission: Submit the completed source code (stack.cpp) file containing functioning code that starts with a header comment containing a title (name, course, date, project number) and your brief process summary.