Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++ conduct the following Create a class Rectangle that has data items such as length, width and height as double. Initialize the data values

Using C++ conduct the following

Create a class Rectangle that has data items such as length, width and height as double. Initialize the data values in the default constructor. Write get methods for each data items. Write set methods for each data items to assign a value to a data item. Write a method called calc_area that calculates area (which is length * width) of the rectangle and return the result as double value. Write a method called calc_ratio that calculates ratio (height / width) of the rectangle and return the result as double value. Write another method called calc_vol that calculates the volume of rectangle which is volume= + 2 the method return the volume variable. Create two objects of class Rectangle, and read data of the class variables and find out area, ratio and volume of both objects and display.

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

ISBN: 0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago