Description
QUESTION 1
PP4.1 on p. 202. The Counter class has no setter and toString methods. The CounterTest class is posted on Acorn. Submit both Counter.java and CounterTest.java
QUESTION 2
PP4.3 on p. 202. Use Math.PI and Math.pow in the volume/area formulas. There is only one instance variable. The formula for volume should only be coded once. Similarly for area. MultiSphere is posted on Acorn. Submit both Sphere.java and MultiSphere.java
QUESTION 3
PP4.6 on p. 203. Only 4 instance variables allowed. The instance variable full is of type boolean, the others are int’s. Name the getter method for full isFull instead of getFull. There is a typo in the text. Method toString returns a single String which contains 2 lines of text. BoxTest is provided on Acorn. Submit both Box.java and BoxTest.java