Question: Create a class Student with data members age and marks, both of type integer. Provide a parameterized constructor and a set member function to set
Create a class Student with data members age and marks, both of type integer. Provide a parameterized constructor and a set member function to set the data members. The age should be a positive number between 15 and 40 while the marks should be between 0 and 100. Create a class Invalid Range as and 100 exception handler of the Student class. The student class should throw an exception if any of its member functions attempts to assign an invalid value to the data members.
In the main program, create objects of class student, assign valid/invalid values to the data members and catch the exceptions accordingly
Step by Step Solution
3.30 Rating (150 Votes )
There are 3 Steps involved in it
Solution Code and output pragma once includeStudenth include using name... View full answer
Get step-by-step solutions from verified subject matter experts
