Write a class declaration that represents a TriangularPrism. Long The private member variable that is associated with Tr
Posted: Sun May 15, 2022 2:01 pm
Write a class declaration that represents a TriangularPrism. Long The private member variable that is associated with Triangular Prism class: o double Width. double Height o double Length ostatic integer variable Count. (0.25 Mark) Member functions that can be performed on TriangularPrism class: Constructor that accept three arguments and assign their values to the Width, Height and Length member's variables (0.25 Mark) Copy constructor function that initialize Width, Height and Length member's variables using another object of the same class. (0.5 Mark) setAll function: set Width, Height and Length members variables. (0.25 Mark) getTPCount as a static member function that count and returns the number TriangularPrism of objects. (0.25 Mark) o getBaseArea function that returns the base area of the TriangularPrism. However the area is calculated as 1/2 * Width * Height (0.25 Mark) o getVolume function that returns the volume of the Triangular Prism. However the volume is calculated as getBaseArea * Length. (0.25 Mark) *
Member operator== overloaded function to test if two TriangularPrisms volumes are equal or not. (0.5 Mark) Friend Operator+ overloaded function that add the volumes of two TriangularPrisms. (0.5 Mark) Write a program (main function) that test TriangularPrisms class as follow: o Write a statements that defines two objects of the TriangularPrisms class. One using argument constructor and one using copy constructor. (0.25 Mark) o Print the number of created objects by calling getTPCount. (0.25 Mark) Print the result of comparing the volumes between two objects calling Member operator == overloaded function. (0.25 Mark) Print the result of adding two objects volumes calling Member operator+ overloaded function. (0.25 Mark)
Member operator== overloaded function to test if two TriangularPrisms volumes are equal or not. (0.5 Mark) Friend Operator+ overloaded function that add the volumes of two TriangularPrisms. (0.5 Mark) Write a program (main function) that test TriangularPrisms class as follow: o Write a statements that defines two objects of the TriangularPrisms class. One using argument constructor and one using copy constructor. (0.25 Mark) o Print the number of created objects by calling getTPCount. (0.25 Mark) Print the result of comparing the volumes between two objects calling Member operator == overloaded function. (0.25 Mark) Print the result of adding two objects volumes calling Member operator+ overloaded function. (0.25 Mark)