Homework 1: Triangle Class

Description

This is a warm up assignment designed to get you comfortable with compiling your assignments on linprog.  
All the information you need to complete this assignment is contained in the first two lectures.

You have been given 2 files:
triangle.h - contains class declaration for the Triangle class
triangle.cpp - contains class definition for the Triangle class


Your assignment is simply to write a driver program in a file named 'driver.cpp' that does the following:

  • Declares three objects of the Triangle class
  • Asks the user for the length and height of each triangle
  • Store the length and height of the triangles in their respective objects
  • Output each triangle's area using the PrintArea() member function
  • You should submit BOTH your source code named 'driver.cpp' and the executable file you create on linprog named 'driver.exec'. You can change the default execuatable name from a.out by using the -o modifier when compiling with g++ (ex. g++ ... -o driver.exec ). Extra Credit Because this assignment is designed to get you started coding ASAP, 10 bonus points will be awarded to students who submit a completely correct solution before next class (May 19).