Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following is a formal description of the Cylinder object type. The description includes the constructor (Cylinder) that initializes the radius and height attributes of

The following is a formal description of the Cylinder object type. The description includes the constructor (Cylinder) that initializes the radius and height attributes of an object and access operations to update the attributes or retrieve their current values.

Attributes:

myRadius

myHeight

Operations:

Cylinder Assigns zero to both radius and height of an uninitialized cylinder (default constructor)

Cylinder Takes initial values radius and height as arguments and assigns them as the myRadius and myHeight of the cylinder (explicit constructor)

endArea Computes ? * myRadius2 and returns the value as the end area of the cylinder

sideArea Computes 2 * ? * myRadius * myHeight and returns the value as the side area

volume Computes the end area * myHeight and returns the value as the volume

setDimensions Takes values radius and height as arguments and updates the attributes myRadius and myHeight to have the values radius and height respectively ( a function to change attributes of a cylinder)

getRadius Returns the current value of myRadius

getHeight Returns the current value of myHeight

The requirements of todays lab are to implement a cylinder object. Write the class definition and put it into a header file called cylinder.h and put the function implementation into cylinder.cpp. Create a driver to test your class definition. Turn in the source listing of the two class cylinder files

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

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions

Question

=+professionalism and competency in handling global HR issues?

Answered: 1 week ago

Question

=+3 In what ways can an MNE improve or change its approach to IHRM?

Answered: 1 week ago