Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Java to create the following classes below. Create an inheritance hierarchy of classes as follows. Person Create a class called Person with the following

Using Java to create the following classes below.

Create an inheritance hierarchy of classes as follows.

Person

Create a class called Person with the following instance variables, constructor arguments, setters and getters:

- First name - Last name - Year of birth - Gender: male or female

Also include a printDetails method which displays details in the following format:

Oprah Winfrey is a Person. She was born in 1954. Or Tiger Woods is a Person. He was born in 1975.

Note: Use the getClass().getName() method on the object to print the word Person in the getDetails method.

Student

Extend the Person class and create a Student class. Add student fields (and constructor arguments and setters and getters) for the following:

- Student number - Major (e.g. computer science) - Grade point average (e.g. 4.0)

Also include a printDetails method which displays details in the following format:

Mark Zuckerberg is a Student of computer science (st# 12345678). He was born in 1984. Or Michelle Obama is a Student of law (st# 98765432). She was born in 1964.

Note: Use the getClass().getName() method on the object to print the word Student in the getDetails method.

BCITStudent

Extend the Student class and create a BCITStudent class. Add fields (and constructor arguments and setters and getters) for the following:

- Student numbers must be in the format of A######## - Campus (must be Burnaby, Downtown, Richmond, or North Vancouver)

Also include a printDetails method which displays details in the following format:

Markus Frind is a BCITStudent of computer science (st# A12345678) at the Downtown campus. He was born in 1979. Or Gloria Macarenko is a BCITStudent of journalism (st# A88877777) at the Burnaby campus. She was born in 1962.

Note: Use the getClass().getName() method on the object to print the word BCITStudent in the getDetails method.

School

Create a School class that has the following instance variables:

- A president (who is a Person; in the constructor set it to: Kathy Kinloch, born 1960) - A HashMap of Students (key is student number; value is Student)

In the constructor, add all of the students listed on the previous pages into the HashMap. Then iterate through the HashMap and call each students getDetails() method. Also call the presidents getDetails() method too.

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 Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago