Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ARIZONA STATE UNIVERSITY CSE100 Principles of Programming with C++ Lab Assignment # 14: Out 11/26/2018, Due 11/30/2018 at 11:59 P.M. on Blackboard All assignments are
ARIZONA STATE UNIVERSITY CSE100 Principles of Programming with C++ Lab Assignment # 14: Out 11/26/2018, Due 11/30/2018 at 11:59 P.M. on Blackboard All assignments are to be completed and written individually, although general strategies can (and are encouraged) be discussed with anyone. Refer to the Syllabus for more information on Academic Integrity Policies. No late assignments are accepted. Unlimited submissions are allowed, but only the last complete submission is graded. Submission details are located at the end of this document, and will be similar on subsequent assignments. The Lab We wi be creating our own exception here. Include the exception header, and create a class called my.exception that inherits from the class called exception. This class is the super class that is by convention used for all exception handling in C++. Override the function whatO that returns a const char* (also make sure to declare it virtual!). In this function, return "CSE100' s Last Lab!". The purpose of the function is to return a helpful error message as to what happened to cause the exception Now create a main function, and a try/catch block, as well as an instance of the my exception class. In the try block, immediately throw the instance, and the catch block as its argument takes an object of type exception (note: not my exception) by reference, and inside the block prints the result of calling what ) on the passed in object. (Think about why it prints what you expect; what if we didn't declare the function virtual?) Submit your C program in the file lab14-fname-1name.cpp
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started