Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To get Upvote you should solve all three parts of the question. (30 pts) Right Triangle with Sides (Parts a - d). Let's say we

image text in transcribed

image text in transcribed

image text in transcribed

To get Upvote you should solve all three parts of the question.

(30 pts) Right Triangle with Sides (Parts a - d). Let's say we need to design two classes, one named side and one named RightTriangle. Each side consists of one double precision value representing mlength, which is stored in centimeters (cm). A RightTriangle is defined by three sides. We will assume that the sides always form a RightTriangle (i.e. two of the sides form a 90-degree angle). a. (7 pts) Declare the side class based on the description above. There are many operations that We could define for a side, but we are only going to look at a subset for this problem. All 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 0. ii. (2 pts) A const function called getLength() for getting the mlength. iii iii. iz pts) A function called displayLength (0 for displaying to the screen the length of (2 pts) A function called 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: I should contain three prototypes/declarations

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

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions