Commit e37f8e85 authored by austin.blanke's avatar austin.blanke

Almost done rectangle

parent 89aec285
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
public class Rectangle extends Shape {
int width;
int height;
public Rectangle() {
width = 3;
height = 4;
}
public Rectangle(int i, int j) {
width = i;
height = j;
}
@Override
public void draw() {
}
@Override
public float area() {
float area = height * width;
return area;
}
@Override
public float circumference() {
float circumference = (2 * height) + (2 * width);
return circumference;
}
public int getWidth() {
return width;
}
public void setWidth(int w) {
width = w;
}
public int getHeight() {
return height;
}
public void setHeight(int h) {
height = h;
}
@Override
public void draw(){
}
}
No preview for this file type
...@@ -16,5 +16,6 @@ abstract public class Shape { ...@@ -16,5 +16,6 @@ abstract public class Shape {
public Shape(int size){ public Shape(int size){
this.size = size; this.size = size;
} }
} }
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment