Commit e44790b7 authored by luke.scott's avatar luke.scott

initial commit

parents
public class Rectangle extends Shape{
int width;
int height;
public Rectangle() {
width = 3;
height = 4;
}
public Rectangle(int width, int height) {
this.width = width;
this.height = height;
}
public int getWidth(){return width;}
public int getHeight(){return height;}
public void setWidth(int width){this.width = width;}
public void setHeight(int height){this.height = height;}
public int getSize(){return size;}
public void setSize(int size) { this.size = size; }
@Override
public void draw() {
for (int loop1=0; loop1<size; loop1++){
for(int loop2=loop1; loop2<size; loop2++){
System.out.print("*");
}
System.out.println("");
}
}
@Override
public float area() {
float area = getWidth() * getHeight();
return area;
}
@Override
public float circumference() {
float circ = getWidth() * 2 + getHeight() * 2;
return circ;
}
public static void main(String[] args){
Shape aRectangle = new Rectangle(4);
}
}
\ No newline at end of file
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