Create a class Student with data members age and marks, both of type integer. Provide a parameterized
Fantastic news! We've Found the answer you've been seeking!
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 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
Related Book For
Posted Date: