LAB 11C - TRIANGLE CLASS

Concept

Focus on defining a Triangle class from scratch, in preparation for the exam.

Suggestion (again): Use NotePad or WordPad

Consider using NotePad or WordPad on your computer to write your code for this lab. Once you feel good about what you've written, then copy the code into Visual Studio. Doing this will help you see where you might make mistakes on the exam!

You should write a main.cpp that tests each feature of your class works as expected. You will need to submit your class prototype file, your class implementation file, and your main.cpp file for this lab with Homework 11.

Triangle Class

As you know from earlier assignments (i.e., HW 02, Lab03A, Lab03B, and Lab04A), we have a strange fetish with triangles. Now that you have some skills with classes, write a Triangle class to represent this "thing" to the computer. What properties do you need to represent a triangle? Make these properties private to your class. (You should know why private makes sense; ask if you don't!) In all functions that modify data members, you should always ensure the values being set make sense. Also, use a private helper function wherever one makes sense. Functions you should include in your class:

For added practice, consider using an array to represent the triangle's properties and create an array (or vector) of triangles in main.