Lab #5: Triangle class
Please read over Programming Project 4.1 on page 160 of the text. This project defines the triangle class which you will need to implement. As well you need to use an applet to (1) define a specific triangle, (2) compute properties of the triangle as defined in Project 4.1 and display those in a MessageBox (this will be done in the start() method), and (3) draw the triangle in the window (this will be done in the paint() method). This is worth at most 80 points.
For the last 20 points you want to use DialogBoxes to prompt and read the user for the coordinates of the three points of a triangle (this will be done in the start() method).
I strongly encourage you to carefully think about these two classes using paper and pencil. Careful planning and thought will save you hours of work.
Suggestion #1: Using what we started in class go ahead and sketch out (on paper) triangle with the class variables and interfaces of the methods and constructors. Next sketch in the details of the length method (as I sketched on the board). Now focus on the perimeter method. With these ideas sketched on paper, rewrite them on paper. Once you are ok with these go ahead and and create your triangle class (as an application) and enter what you have so far. It should take very little time to get the syntax errors out. Now go focus of the area method; first on paper to make sure your ideas are exactly what you need, finally add this to the triangle class.
This lab is due by midnight on October 12, 2007. Your labs during the weeks of October 1 and October 8 will be held at the normal times and the TAs will be available during those times to help you.
