Question: Write a function calculateAverage() which takes four int arguments which are marks for four courses in the semester and returns their average as a float.
Write a function calculateAverage() which takes four int arguments which are marks for four courses in the semester and returns their average as a float. The calculateAverage() function should take only valid range for marks which is between 0 - 100. If the marks are out of range throw an OutOfRangeException - define this exception as a class as shown in the lecture and lecture examples. Write the specification for this function as comments above it specifying the pre conditions, post conditions and invariants and what exceptions are thrown when so that the caller understand how it behaves. (USE C++)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
