Question: c++ Write a dass named Triangle to represent a Triangle The class contains: Two double data fields named base and height that specify the base

 c++ Write a dass named Triangle to represent a Triangle The
c++

Write a dass named Triangle to represent a Triangle The class contains: Two double data fields named base and height that specify the base and height of the triangle A constructor with no arguments that creates a triangle with base 3 and height 2. A constructor that creates a default triangle with the specified by the user base and height. The accessor (get) and mutator (set) functions for all the data fields. A function named getAreal that returns the area of this triangle. Write a test program that creates two Triangle objects. Assign base 4 and height 3 to the first object and base 5 and height 8 to the second. Display the prope of both objects and find their areas. 2 A

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 Databases Questions!