CIS 163 AA - Java Programming I - Section 5811
Midterm Exam
Due Monday, October 24, 2005

Name:

I. Definitions: please explain the following terms:

  1. post-fix increment

  2. counter variable

  3. final data member

  4. loop

  5. loop sentinel value

  6. the continue statement

  7. visibility modifier

  8. private visibility

  9. relational operator

II. Question or short essay

  1. What is the value of creating an outline of your solution before you begin coding?

  2. How are constructors defined?

  3. What is the purpose for the init method for an applet?

  4. What is an infinite loop? How do you avoid it?

  5. How would you use a break statement in a switch structure?
III. Programming Exercises Write source code for the following:

    Write a cube class. It has three essential characteristics: a height, width, and length (these don’t have to be the same size). Each face of the cube is a rectangle and has an area. The cube also has a volume defined as the product of the essential characteristics as well as a surface area defined by the sum of the areas of each face. Include a constructor, a method to find the volume, and a method to find the surface area