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
Step: 1
Solution Code and output pragma once includeStudenth include using name...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
C++ Primer Plus
Authors: Stephen Prata
6th Edition
978-0321776402, 0321776402
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App