Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

C++ 1. Complete the implementation (boxed in red) of the classes circle and cylinder as declared in the following program.(The main program and declaration are

C++

1. Complete the implementation (boxed in red) of the classes circle and cylinder as declared in the following

program.(The main program and declaration are already provided) Your program output should look like: image text in transcribed

THIS IS THE CODE:

image text in transcribed

image text in transcribed

image text in transcribed

), radius -3) circentre - (1,'2 cylbase - (centre - (1,2), radius -3), height -7) Declaration of Figures Classes File: figures.h classes which represent points , circles and cylinders in the plane */ #ifn d e f FIGURES-H FIGURES-H #define #include #include using namespace std; class point private: float x; float y; public: point (float a, float b); void write (ostream & out) const;//write a point in the form (x,y) x - a and y - b class circle { private: point centre; float radius; public: circle (float a, float b, float r); void write (ostream & out) const; class cvlinder private: circle base; float height; public: cylinder (float a, float b, float r, float h); void write (ostream & out) const; #endif /* FIGURES-H */ Implementation of Figures Classes /* File: figures cpp #include "figures. h" Implementation of classes point, circle, and cylinder */ point :: point (float a, float b) // x = a and y = b x = a; y=b; void point: write (ostream & out) const // write a point in the form (x,y) Main Program Using Figures Classes File: testfigures . cpp Application program using classes point, circle , and cylinder Programmer: your name Date: #include "figures. h" int main (void) point p (1.0, 2.0; cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions