Commit 7d98d415 authored by jinny.wilkin's avatar jinny.wilkin

incomplete upload1

parent 89aec285
public class Rectangle extends Shape{
public Square() {
super();
}
public Square(int i) {
super(i);
}
public void draw(){
for (int i = 0; i <= size+1; i++) {
if (i == 0 || i == size+1) {
for (int j = 0; j < size; j++) {
System.out.print("--");
}
System.out.println(""); //enter a new line
} else {
//else
for (int j = 0; j <= size; j++) {
if (j == 0 || j == size - 1) {
System.out.print("| ");
} else {
System.out.print(" "+" ");
}
}
System.out.println(""); //enter a new line
}
}
}
//@Override
public float area() {
float fSize = size;
float area = fSize * fSize;
return area;
}
//@Override
public float circumference() {
float fSize = size;
float circ = fSize + fSize +fSize +fSize;
return circ;
}
}
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