Calvin seal CS 108: Introduction to Computing
Spring 2006

Project #3

The Project

Create an edu.calvin.USERNAME.hotj.project03 package, and a test-case classes named QuickQuiz3_3Test, QuickQuiz3_4Test, QuickQuiz3_5Test, and QuickQuiz3_6Test.

Use the following questions from the Quick Quizzes to write some tests:

  • Quick Quiz #3.3 (p. 118): questions #16--27.
  • Quick Quiz #3.4 (p. 128): questions #16--23.
  • Quick Quiz #3.5 (p. 136): questions #9--13.
  • Quick Quiz #3.6 (p. 143): questions #11--16.

Each question should be written as a separate test method. Use the assertion comments to explain what (most likely) is being tested.

Here's an example to get you started. Consider Question #16 of Quick Quiz #3.3. In QuickQuiz3_3Test, I create a test method named testQuestion16(); then I write an assertEquals() statement for the question:

public void testQuestion16() {
  assertEquals("testing operator associativity", 0, 3 - 2 - 1);
}

If a Quick Quiz declares some variables, go ahead and declare those same variables in your code. You may have to declare the variables more than once in different test methods.

If an expression for a question is invalid Java code, write a comment describing the error (instead of writing an assertion for it).