Description: Implement function getPercentage that takes two inputs : grade and totalGrade and outputs the grade percentage as follows: percentage = (grade/total grade)*100. (Assume a student can not...


Answer in c++ Please.


Description:<br>Implement function getPercentage that takes two inputs : grade and totalGrade and outputs the grade<br>percentage as follows: percentage = (grade/total grade)*100. (Assume a student can not get a grade<br>above 100%)<br>Define your own exception classes:<br>1. DivideByZeroException as a derived class of Standard Library class runtime_error, that is used<br>to detect division by zero run time error.<br>2. NegativeNumberException as a derived class of Standard Library class logic_error, that is used<br>to detect if the user entered a negative number as a grade.<br>3. InvalidGradeException as a derived class of Standard Library class logic_error, that is used to<br>detect if a user entered an invalid input (grade greater than total grade).<br>Use the above exception classes after implementing them to apply exception handling for your<br>getPercentage function.<br>

Extracted text: Description: Implement function getPercentage that takes two inputs : grade and totalGrade and outputs the grade percentage as follows: percentage = (grade/total grade)*100. (Assume a student can not get a grade above 100%) Define your own exception classes: 1. DivideByZeroException as a derived class of Standard Library class runtime_error, that is used to detect division by zero run time error. 2. NegativeNumberException as a derived class of Standard Library class logic_error, that is used to detect if the user entered a negative number as a grade. 3. InvalidGradeException as a derived class of Standard Library class logic_error, that is used to detect if a user entered an invalid input (grade greater than total grade). Use the above exception classes after implementing them to apply exception handling for your getPercentage function.

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here