Question: Create a class named 'Triangle' with the following members. Please NOTE that (1) all class, variable, and function names must match the description for the

Create a class named 'Triangle' with the following members. Please NOTE that (1) all class, variable, and function names must match the description for the unit testing to succeed; (2) invalid triangle should return 0 when size is calculated and return -1 when type is checked. private: side1,side2,side3. All double variables; public functions: -default constructor that sides to 0, a second constructor that set all three sides given the values setSide1 and getSide1 setSide2 and getSide2 setSide2 and getSide2 isSidesValid function that verifies if given three sides form a valid triangle getArea function that calculates the area of a valid triangle

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!