Questions and codes:
/*copyright (c) 2016, College of Computer and Control engineering, Yantai University *all rights reserved.* file name: main.cpp* Author: Wang Lin * completion date: May 9, 2016 * version number: v1.0* Problem Description: Then the Circle class as the direct base class, derive a cylinder (cylinder) class, and then increase the data member H (high), and the cylinder surface area of the member function areas and the cylinder volume member function volume, to achieve the required member functions, and design the main function to complete the test. * Input Description: * Output Description: */#include <iostream>using namespace Std;class point{public:point (double x=0,double y=0); void Show ();p rotected:double x, y;}; Point::P oint (double a,double b) {x=a; Y=b;} void Point::show () {cout<< "[" <<x<< "," <<y<< "]" <<ENDL;} Class Circle:public point{public:circle (double x=0,double y=0,double r=0); Double area (); void Show ();p rotected:double radius;}; Circle::circle (double a,double b,double R):P Oint (A, B), radius (r) {}double Circle::area () {return 3.14159*radius*radius ;} void Circle::show () {cout<< "center= (" <<x<< "," <<y<< "), r=" <<radius<< ", Area= "<<area () <<endl;} Class Cylinder:public Circle{public:cylinder (double x=0,doubleY=0,double r=0,double h=0); Double area (); void Show (); Double volume ();p rotected:double height;}; Cylinder::cylinder (double a,double b,double r,double h): Circle (a,b,r), height (h) {}double Cylinder::area () {return Circle::area () +2*3.14159*radius*height;} Double Cylinder::volume () {return circle::area () *height;} void Cylinder::show () {cout<< "center: [" <<x<< "," <<y<< "], r=" <<radius<< ", h=" <