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
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
Get step-by-step solutions from verified subject matter experts
