Question
Task 1 Circle -radius:double = 5.0 -color:String = Green +Circle() +Circle(radius:double) +Circle(radius:double, color:String) +getRadius():double +setRadius(radius:double):void +getColor():String +setColor(color:String):void +getArea():double Cylinder -height:double = 1.0 +Cylinder() +Cylinder(radius:double, height:double)
Task 1
|
|
For task 1, implement the two classes (Circle and Cylinder) that are described above. Note that class Cylinder is derived from the superclass Circle -- in other words Cylinder inherits from Circle. Make sure that the subclass Cylinder invokes the superclass' constructors (via super() and super(radius)) and correctly inherits the variables and methods from the superclass Circle.
Task 2
|
|
For task 2, implement the three classes (Person, Student, and Staff) that are described above. Note that classes Staff and Student are derived from the superclass Person -- in other words Staff and Student inherit from Person. Make sure that the subclasses Student and Staff invoke the superclass' constructors and correctly inherit the variables and methods from the superclass Person. Also note that Person is an abstract class.
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