Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve the problem 12. (30 pts) Right Triangle with Sides (Parts a - d). Let's say we need to design two classes, one Side

image text in transcribed
image text in transcribed
Please solve the problem
12. (30 pts) Right Triangle with Sides (Parts a - d). Let's say we need to design two classes, one Side and one named RightTriangle. Each Side consists of one double precision mLength, which is stored in centimeters (cm). A RightTriangle is defined by three sides. We assume that the sides always form a RightTriangle (i.e. two of the sides form a 90-degree angte value representing will a. (7 pts) Declare the Side class based on the description abov e. There are many operations that we could define for a side, but we are only going to look at a subset for this problem. attributes/data members should be private. The class should declare the following public member operations/functions only: i. (2 pts) A constructor that specifies one arguments newlength sets it by default to o. i. (2 pts) A const function called getLength() for getting the miength. ii. (2 pts) A function called displayLength() for displaying to the screen the length of the side in the form: mlength inches. Note you need to display the length in inches! Recall, 1 inch-2.54 cm class Side public:// Should contain three prototypes/declarations Rashenal C) private: // Should contain one attributes Joublt side 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions