Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design and implement a class that will simulate a cylinder; call the class Cylinder. Name your instance variables radius and height. Have functions called calculateSurfaceArea

Design and implement a class that will simulate a cylinder; call the class Cylinder. Name your instance variables radius and height. Have functions called calculateSurfaceArea and calculateVolume. Implement Accessors and Mutators for all instance variables of the class. Have two constructors; the first will be the default constructor (set all instance variables to 1) and the second will be a constructor that will pass values to set the instance variables to the object. Develop a function printCylinderInfo which will print a four line description of the cylinder. It will output a neat formatted string showing the radius and height of the object as well as the objects surface area and volume. Use two decimal points of accuracy with the printCylinderInfo method. You may hard code the data for three Cylinders (you'll need radius and height for each). Create a Cylinder object for each, and use the functions of the Cylinder class to print out the height, radius, volume, and surface area of each cylinder. Use the data in the image. image text in transcribed

myCylinder01 7.3 3.1 myCylinder02 myCylinder03 2 4 radius height

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions