ardila 0 Newbie Poster

PROJECT 6: MIRROR CALCULATIONS
DUE by midnight 11/04/08

INTRODUCTION
This is the first of a 3-project series. The next two projects, pro7 and pro8 will expand on this assignment. Therefore, it is important that you do well in pro6.

This project is your introduction to object-oriented programming (OOP). Here, you will develop your first object class, the Mirror class. The definition of the Mirror class and a detailed explanation is given later in this text. Even though the main focus is on OOP, pro6 also involves arrays and file processing, topics that have been covered in pro5. In pro5, your program read data from an ASCII file. In pro6, it will create a data file and write to it as well.

BACKGROUND
In this assignment, you will write a program that calculates the height and the distance of the image of an object that is placed in front of a mirror. The mirror can be concave or convex.

The following figure shows a concave mirror with an object (pencil) placed in front of it. The image of the object is inverted and falls between the focal point (f) and the radius (r).

Figure 1. Image formation in a concave mirror.

The next figure shows the image formation in a convex mirror. Note that the image is not inverted and it is on the other side of the mirror.

Figure 2. Image formation in a convex mirror.

You will use the following formulas to compute the height of …