CIS 163 AA - Java Programming I - Section 5811
Midterm Exam
Due Monday, October 24, 2005
Name:
I. Definitions: please explain the following terms:
- post-fix increment
- counter variable
- final data member
- loop
- loop sentinel value
- the continue statement
- visibility modifier
- private visibility
- relational operator
II. Question or short essay
- What is the value of creating an outline of your solution before you begin coding?
- How are constructors defined?
- What is the purpose for the init method for an applet?
- What is an infinite loop? How do you avoid it?
- 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