write the definition of a class Triangle in c++ containing: a data member base of type double. a data member height of type double. a default constructor that assigns the values 25 and 20 to the member variable base and height, respectively. an overloading constructor that accepts two arguements of type double and assigns them to the base and height member varaibles a member function called getBase that accepts no parameters and returns the value of base. a member function called getHeight that accepts no parameters and returns the value of height. a member function called getArea that accepts no parameters and returns the area of the triangle. a destructor that displays the following message on the screen: Triangle is destroyed.
write the definition of a class Triangle in c++ containing:
a data member base of type double.
a data member height of type double.
a default constructor that assigns the values 25 and 20 to the member variable base and height, respectively.
an overloading constructor that accepts two arguements of type double and assigns them to the base and height member varaibles
a member function called getBase that accepts no parameters and returns the value of base.
a member function called getHeight that accepts no parameters and returns the value of height.
a member function called getArea that accepts no parameters and returns the area of the triangle.
a destructor that displays the following message on the screen: Triangle is destroyed.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images