| Quiz | Posted (Thursdays) |
Given in class (Thursdays) |
||
|---|---|---|---|---|
| 31 | Oct | 7 | Nov | |
You will fare better on the quiz if you try working the problems before looking at the solutions. If you don't understand the question or its answer, please get help.
StackBasedQueueOfInts given the class
StackOfInts.
QueueBasedStackOfInts given the class
QueueOfInts.
StackBasedQueueOfInts
and QueueBasedStackOfInts in terms of each other?
public class Rectangle {
protected int length, width;
protected Rectangle() {
length = 0;
width = 0;
}
public Rectangle(int length, int width) {
this.length = length;
this.width = width;
}
public int area() { return length * width; }
public int perimeter() { return 2*length + 2*width; }
}
Write a class for a Square by extending this class.