Question: 5.2.1 Task-1 CLO(2,4) Try to Create a class named Trigon inherited from the class Geometric Shape (containing a single data member named shapeName (a string)

 5.2.1 Task-1 CLO(2,4) Try to Create a class named Trigon inheritedfrom the class Geometric Shape (containing a single data member named shapeName

5.2.1 Task-1 CLO(2,4) Try to Create a class named Trigon inherited from the class Geometric Shape (containing a single data member named shapeName (a string) and a member function named setShapeName(shapeName). The class Trigon is required to hold: Three data members i.e. base, perpendicular, and hypotenuse of type double A no-arg constructor that initializes all data members with value 1.0 A parameterized constructor to initialize all data fields with user-defined values The setter functions for all three data fields The accessor functions for all three data fields A function named displayArea() that shows the area of a certain Trigon object . In the main() function make three objects of class Trigon while considering the shapeName as threeangle for each object. In addition, it is required to invoke all the functions of Trigon class. 5.2.1 Task-1 CLO(2,4) Try to Create a class named Trigon inherited from the class Geometric Shape (containing a single data member named shapeName (a string) and a member function named setShapeName(shapeName). The class Trigon is required to hold: Three data members i.e. base, perpendicular, and hypotenuse of type double A no-arg constructor that initializes all data members with value 1.0 A parameterized constructor to initialize all data fields with user-defined values The setter functions for all three data fields The accessor functions for all three data fields A function named displayArea() that shows the area of a certain Trigon object . In the main() function make three objects of class Trigon while considering the shapeName as threeangle for each object. In addition, it is required to invoke all the functions of Trigon class

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!