Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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() GRADUATION-YEAR() DISTINCTION() such as DEGREE(Computer Science) GRADUATION-YEAR(2023) DISTINCTION(yes) or DEGREE(Biology) GRADUATION-YEAR(2022) DISTINCTION(no)

"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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

=+1 What are the major issues related to international T&D?

Answered: 1 week ago