Question
Question 2 (Inheritance): 5 Points You are given classes called Person , Student , Faculty , Employee and Manager . Assume that the class Person
Question 2 (Inheritance): 5 Points
You are given classes called Person, Student, Faculty, Employee and Manager.
Assume that the class Person is defined as follows:
public class Person {
public String getName() {
}
}
1. Complete the class definitions below:
public class Student {
public int getId() {
}
}
public class Faculty {
public String getRank() {
}
}
public class Employee {
public double getSalary() {
}
}
public class Manager {
public Boolean getStatus() {
}
}
2.1 Complete the main() method below to create an array of 200 objects of different types (Person, Student, Faculty, Employee and Manager) in a random fashion.
public static void main(String[] args) {
}
2.2 Make sure to call the following methods in the main() method:
public String getName()
public int getId()
public String getRank()
public double getSalary()
public Boolean getStatus()
public static void main(String[] args) {
}
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