Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Teacher class This class extends the Person class. It also has an additional instance variable and its accessor method: String specialty and public String getSpecialty

Teacher class
This class extends the Person class. It also has an additional instance variable and its accessor method: String specialty and public String getSpecialty().
public Teacher (Date born, Name name, String specialty): this constructor throws IllegalPersonException exceptions if born or name is null. Also, it throws an IllegalPersonException exception if specialty is blank (note: null is ok).
COMP2601 Assignment 1 of 2 Due Before Lesson 9
5
This class overrides the public String toString() method, which returns a String in one of these two exact formats:
a) Alive people example: "Tiger Woods (specialty: mathematics) was born 1975-12-30 and is still alive"
b) Dead people example: "Albert Einstein (specialty: mathematics) was born 1879-03-14 and died 1955-04-18"
Use the parent's getName() return value, then its getPrettyName() method, and the born/died getYyyyMmDd() method.

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_2

Step: 3

blur-text-image_3

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

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

2. How do they influence my actions?

Answered: 1 week ago