Functions in c++, programming homework help
Functions in c++, programming homework help
Write a function called do_stuff that accepts 2 arguments, a and b, of type int. The function does nothing except verify that a and b are both non-negative. The function will check the variable a first and if it is negative will invoke an exception with type A_is_negative. If a checks out ok it will then check b and if b fails the test then the function will invoke an exception with type B_is_negative. In addition to writing the function you must define your exception classes for a and b and write a short main program that will call the function and print either a is negative or b is negative depending on the exception that is thrown. This is simply a test of mechanics and should not be considered a “good” use of exception handling.
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


