Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Chapter 10 defined the class circleType to implement the basic properties of a circle. (Add the function print to this class to output the radius,

image text in transcribedChapter 10 defined the class circleType to implement the basic properties of a circle. (Add the function print to this class to output the radius, area, and circumference of a circle.) Now every cylinder has a base and height, where the base is a circle. Design a class cylinderType that can capture the properties of a cylinder and perform the usual operations on the cylinder. Derive this class from the class circleType designed in Chapter 10. Some of the operations that can be performed on a cylinder are as follows: calculate and print the volume, calculate and print the surface area, set the height, set the radius of the base, and set the center of the base. Also, write a program to test various operations on a cylinder.

Programming Exercise 11-3 Instructions Instructions circleType.h circleTypelmp.cpp cylinderType.h cylinderTypelmp.cppmain.cpp enu 3 #define circleType_A 4 #include iostream 5 #include 6 #include main.cpp: 10:5: erron s not declared in this scope cir' wa Chapter 10 defined the class circleType to implement the basic properties of a circle. (Add the function print to this class to output the radius, area, and circumference of a circle.) Now every cylinder has a base and height, where the base is a circle. Design a class cylinderType that can capture the properties of a cylinder and perform the usual operations on the cylinder. Derive this class from the class circleType designed in Chapter 10. Some of the operations that can be performed on a cylinder are as follows: calculate and print the volume, calculate and print the surface area, set the height, set the radius of the base, and set the center of the base. Also, write a program to test various operations on a cylinder print() > 7 #include "circleType.h" 8 using namespace std; 10 class circleType 12 public: main.cpp: 10:5: note: suggested A-T alternative: char cir.print() void print char main.cpp: 12:5: error rType' was not declared in thi s scope 14 15 void setRadius (double r); 16 17 18 19 0 double getRadius) 21 cylinde //Function to set the radius //Postcondition: if (r) radius-r cylinderTyp otherwise radus ; cyl (4, 9, 3. 5, 6.2); //Function to return the radius. //Postcondition: The value of radius is returned main.cpp:15:5: erron s not declared in this scope cyl' wa 23 24 double area) 25 26 27 28 double circumference) 29 cyl. print() //Function to return the area of a circle //Postcondition: Area is calculated and returned bash: line 2: /a.out: Grading file ort ory //Function to return the circumference of a circle

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

Developing and delivering learning that is integrated with the job.

Answered: 1 week ago

Question

Use of assessments to determine trainees learning styles.

Answered: 1 week ago

Question

7. Discuss the advantages of embedded learning.

Answered: 1 week ago