Created
April 11, 2016 18:18
-
-
Save guyhughes/c43d89cf6c5a6569a12e5aa3955b6712 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Question 5 | |
* All of these classes should be public and in their own file. | |
*/ | |
class Shape { | |
protected double x,y; | |
public Shape(double x, double y){ | |
this.x=x; | |
this.y=y; | |
} | |
} | |
class Ellipse extends Shape{ | |
protected double radius, major, minor; | |
public Ellipse(double x, double y, double radius, double major, double minor){ | |
super(x,y); | |
this.radius=radius; | |
this.major=major; | |
this.minor=minor; | |
} | |
} | |
class Circle extends Ellipse{ | |
public Circle(double x, double y, double radius){ | |
super(x,y,radius,2*radius,2*radius); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment