1. Person (abstract class) that has the following: Data Fields: private String name, private String address Constructor: Constructor to create a Person object with specified name and address. Methods: Accessor and mutator methods for all data fields. 2. Student (extend the class Person) that has the following: Data Fields: private int ID, private double grade Constructor: Constructor to create a Student object with specified name, address, ID & grade. Methods: Accessor and mutator methods for all data fields. 3. Director (extend the class Person) that has the following: Data Fields: private double salary. Constructor: Constructor to create a Director object with specified name, address, and salary. Methods: Accessor and mutator methods for salary data field. 4. GraduateStudent(extend the class Student) that has the following: Data Fields: - Constructor: Constructor to create a GraduateStudent object with specified name, address, ID, and grade. Methods: -

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter11: More Object-oriented Programming Concepts
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question

Design UML diagram for the above classes.

Answer all the questions:
B1. Given the following classes, answer the below questions.
1. Person (abstract class) that has the following:
Data Fields: private String name, private String address
Constructor: Constructor to create a Person object with specified name and address.
Methods: Accessor and mutator methods for all data fields.
2. Student (extend the class Person) that has the following:
Data Fields: private int ID, private double grade
Constructor: Constructor to create a Student object with specified name, address, ID & grade.
Methods: Accessor and mutator methods for all data fields.
3. Director (extend the class Person) that has the following:
Data Fields: private double salary.
Constructor: Constructor to create a Director object with specified name, address, and salary.
Methods: Accessor and mutator methods for salary data field.
4. GraduateStudent(extend the class Student) that has the following:
Data Fields: -
Constructor: Constructor to create a GraduateStudent object with specified name,
address, ID, and grade.
Methods: -
Transcribed Image Text:Answer all the questions: B1. Given the following classes, answer the below questions. 1. Person (abstract class) that has the following: Data Fields: private String name, private String address Constructor: Constructor to create a Person object with specified name and address. Methods: Accessor and mutator methods for all data fields. 2. Student (extend the class Person) that has the following: Data Fields: private int ID, private double grade Constructor: Constructor to create a Student object with specified name, address, ID & grade. Methods: Accessor and mutator methods for all data fields. 3. Director (extend the class Person) that has the following: Data Fields: private double salary. Constructor: Constructor to create a Director object with specified name, address, and salary. Methods: Accessor and mutator methods for salary data field. 4. GraduateStudent(extend the class Student) that has the following: Data Fields: - Constructor: Constructor to create a GraduateStudent object with specified name, address, ID, and grade. Methods: -
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Transitive relations
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage