Question
C++ Define a new Degree class that contains a subject (string), the graduation year (integer), and the boolean flag indicating whether this is
C++
Define a new "Degree" class that contains a subject (string), the graduation year (integer), and the boolean flag indicating whether this is a graduation with distinction or not (cum laude)
For example, here is a degree object: - "Computer Science", 2023 and cumlaude (true)
It should have at least the following three methods: "toString" method must return all the certificate information as a string in the following format: DEGREE(
"isSame" method that compares with another Degree object and return true only if the two degrees have the same subject and same year.
"hasError" method that return true if the subject is empty or the year is negative or greater than 2023. It returns false otherwise.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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 Started