Question: Need help writing this program in c ++ Here's the UML class diagram that matches these specifications without all of the required getters and setters:

 Need help writing this program in c ++ Here's the UML

Need help writing this program in c ++

class diagram that matches these specifications without all of the required getters

Here's the UML class diagram that matches these specifications without all of the required getters and setters: - Has the following "protected" attributes: - height \#represents the height of the shape - width \#represents the width of the shape - Has the following methods: - show_dimensions \#prints out the height and width of the shape to_String \#returns a string description of the shape - Has the following Virtual methods: - getArea() getPerimeter() - Has 2 constructors - Shape() // sets both height and width to 0 - Shape(double ht, double wd) // sets height to ht, width to wd Write a Class for a Triangle that implements Shape (derived from Shape) - Has the following attributes in addition to those from Shape: style \#like right or isosceles - Has the following methods: - Any necessary getters/setters - appropriate constructors - getPerimeter() - just return a constant value - 2 constructors - Triangle() // implements Shape() - Triangle (double h, double b, string s) // sets height, base and style Write a Class for a Rectangle that implements Shape (derived from Shape) - Has the following attributes: square \#boolean when true is square, when false is rectangle - Has the following methods: - Any necessary getters/setters (including overriding those from Shape if necessary) - appropriate constructors - Has 2 constructors - Rectangle() // implements Shape() - Rectangle(double h, double w) // sets height, width and whether square or not Write a tester program that - Instantiates as many Triangles and Rectangles as you need to test all of the Constructors and methods of the Triangle and Rectangle classes - Test all of the Constructors and Methods for Triangle, Rectangle and Shape

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!