Commit 1c2eb981 authored by gavin.white's avatar gavin.white

Upload New File

parent 02561412
public class Square extends Shape {
public Square() {
super();
}
public Square(int i) {
super(i);
}
@Override
public void draw() {
System.out.print(" ");
for(int i = 0; i < size; i++){
System.out.print("--")
}
System.out.println("");
for(int i = 0; i < size; i++){
System.out.print("|");
for(int j = 0; j < size; j++) {
System.out.print(" ");
}
System.out.print("|");
System.out.println("");
}
System.out.print(" ");
for(i = 0; i < size; i++) {
System.out.print("--");
}
System.out.print("");
}
@Override
public float area() {
float floatSize = size;
float area = floatSize * floatSize;
return area;
}
@Override
public float circumference() {
float floatSize = size;
float circumference = 4 * floatSize;
return circumference;
}
}
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