My instructor has made a strong emphasis on not allowing others to make major changes to our program while using classes. Such as make changes unnecessarily to sides of a triangle. I am not completely following, but can somebody take a look at my triangle.h file and see if I'm on the right track?
I think what your instructor was referring to were good encapsulation practices. When you're writing a class, generally the end result is a library or header file for others to use. You shouldn't provide any executable code for others to tamper with - you're simply writing an interface with which they may use your class.
Your code looks good. I'd generally avoid mixing floats and doubles. Pick one and stay consistent. I'm thinking that maybe 'isValid' would be a better name for your 'isTriangle' member function - the impulse is to say that we know it's a triangle by virtue of the fact that it belongs to a Triangle object, when of course what you really meant was whether the triangle is valid or not.
I am making another post. It includes the triangle.h, triangle.cpp, and main.cpp.
I am not doing well in this class and need to score at least 90% on all the homework assignments moving forward. This assignment is worth 20 points, so I'll need at least 18 points of 20.
Well, I'm no teacher and don't plan to be, but the biggest flaw in your code's interface is the presence of isTriangle().
A Triangle object should always be a triangle. There should never be instances of "Triangle" that aren't valid triangles.
When you construct a new Triangle, simply fail if the input is invalid.
If you fixed that, I'd give you a better score.
You could round it out by defaulting your default constructor, and marking the appropriate functions noexcept.
I'll admit, I'm not entirely sold on the last point. This should be a judgement call for you: Is Triangle's implementation likely to change in the future?