Question: Create an application for a right triangle class with separate files for specification, implementation, and client code. (RightTriangle.h, RightTriangle.cpp, Source.cpp) ---------------------------------------------------------------------------------------------------------------------------------------------------------- Instructions: Create an application

Create an application for a right triangle class with separate files for specification, implementation, and client code. (RightTriangle.h, RightTriangle.cpp, Source.cpp)

----------------------------------------------------------------------------------------------------------------------------------------------------------

Create an application for a right triangle class with separate files forspecification, implementation, and client code. (RightTriangle.h, RightTriangle.cpp, Source.cpp) ---------------------------------------------------------------------------------------------------------------------------------------------------------- Instructions: Create anapplication for a right triangle class with separate files for specification, implementation,and client code. UML Diagram for Header (RightTriangle.h) RightTriangle -opposite double -

adjacent double + RightTriangle) + RightTriangle( double, double) + setOpposite( double): bool

+ setAdjacent( double): bool +getOpposite) : double + getAdjacent() : double +calcHypotenuse() : double Implementation Code Instructions (RightTriangle.cpp): Default Constructor: Initialize the private

Instructions: Create an application for a right triangle class with separate files for specification, implementation, and client code. UML Diagram for Header (RightTriangle.h) RightTriangle -opposite double - adjacent double + RightTriangle) + RightTriangle( double, double) + setOpposite( double): bool + setAdjacent( double): bool +getOpposite) : double + getAdjacent() : double + calcHypotenuse() : double Implementation Code Instructions (RightTriangle.cpp): Default Constructor: Initialize the private member variables with a value of 1.0 Overloaded Constructor: This function should have two parameters variables for adjacent and opposite and pass the parameter variables as arguments . Call the mutator functions Mutator functions: Each mutator function should have a Boolean flag to indicate if the parameter variable is valid. If the parameter variable is 1 or greater, then assign this value to the private member variable; otherwise, assign 1.0 to the private member variable and return false Accessor functions: Return the value stored in the private member variables. Calculating the hypotenuse: hypotenuseAdjacent2 Opposite2

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!