Define a class called GATE consisting of members Name, College, Qualification, Email, and CGPA. Define a function called read() to receive values for the above members. Create custom defined exceptions “InvalidEmailException”, “InvalidCGPA” and “NotEligibleQualification”. Raise “NotEligibleQualification” if the qualification is not any of these values: B.Tech / BE. Raise “InvalidCGPA” if the CGPA is not with in range 0 to 10. Raise “InvalidEmailException” if the email-id doesn’t contain a ‘@’ or ‘.’ symbol in the appropriate places.
Define a class called GATE consisting of members Name, College, Qualification, Email, and CGPA. Define a function called read() to receive values for the above members. Create custom defined exceptions “InvalidEmailException”, “InvalidCGPA” and “NotEligibleQualification”. Raise “NotEligibleQualification” if the qualification is not any of these values: B.Tech / BE. Raise “InvalidCGPA” if the CGPA is not with in range 0 to 10. Raise “InvalidEmailException” if the email-id doesn’t contain a ‘@’ or ‘.’ symbol in the appropriate places.
Chapter12: Exception Handling
Section: Chapter Questions
Problem 7PE
Related questions
Question
Define a class called GATE consisting of members Name, College, Qualification, Email, and CGPA. Define a function called read() to receive values for the above members. Create custom defined exceptions “InvalidEmailException”, “InvalidCGPA” and “NotEligibleQualification”.
Raise “NotEligibleQualification” if the qualification is not any of these values: B.Tech / BE.
Raise “InvalidCGPA” if the CGPA is not with in range 0 to 10.
Raise “InvalidEmailException” if the email-id doesn’t contain a ‘@’ or ‘.’ symbol in the appropriate places.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning