Question: Complete Intermediate Exercise # 1 7 at the end of the chapter. Enter the class definition in a header file named Intermediate 1 7 Triangle.h

Complete Intermediate Exercise #17 at the end of the chapter.
Enter the class definition in a header file named Intermediate17 Triangle.h. The class should include a void method that allows the program to set the triangles dimensions. The method should verify that all of the dimensions are greater than 0.0 before assigning the values to the private data members. The class also should include two value-returning methods. One value-returning method should calculate the area of a triangle, and the other should calculate the perimeter of a triangle. The formula for calculating the area of a triangle is 1/2* b * h, where b is the base and h is the height. The formula for calculating the perimeter of a triangle is a + b + c, where a, b, and c are the lengths of the sides. Determine the appropriate variables to include in the class. Be sure to include a default constructor that initializes the variables.
Submit only your Triangle.h File. Do not implement in a separate file. All definitions should be in Triangle.h.
DO NOT MODIFY THE chptr15main.cpp file. DO NOT CHANGE THE CLASS DECLARATIONS of Triangle.h.
Only modify the Triangle.h File by adding function implementations.
You can test your implementation of Triangle.h by running chptr15main.cpp. Do not modify the chptr15main.cpp file, as you will be tested against the one attached to this assignment.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!