Question: Write pseudocode and C + + code for a program that does the following: Create a function that takes two integers as arguments and returns

Write pseudocode and C++ code for a program that does the following:
Create a function that takes two integers as arguments and returns a float.
Return the result of dividing the two integers, checking for division by zero.Use a throw statement when a divide by zero occurs using the error message "Divide by Zero"
Create a second function that takes two integers as arguments and returns an integer.
Check the arguments to verify they are positive numbers.Use a throw statement when one of the numbers is negative, returning the number 999.
Create a main() function that calls the two functions defined above.
Use a try-catch block to catch both types of exceptions.Run the program twice, causing each exception once.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!