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 # at the end of the chapter.
Enter the class definition in a header file named Intermediate 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 before assigning the values to the private data members. The class also should include two valuereturning methods. One valuereturning 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 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 chptrmain.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 chptrmain.cpp Do not modify the chptrmain.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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
