Answers to the Quarterly Tests

Test Scope Answer
Test-ACh 1-3
Test-BCh 1-6
Test-CCh 7-9
Test-DCh 7-12

Note about I/O and Contract Classes

Some of the questions (and answers) in these tests use the IO and SE classes (of type.lang) to perform input/output operations and contract declarations. The examples in the book use Scanner, PrintStream, and ToolBox to perform these functions. As far as these tests are concerned, the two approaches are equivalent and one can easily translate one to the other. For example, IO.readDouble() is similar to input.nextDouble(), IO.print is similar to output.print, and SE.require is similar to ToolBox.crash.