/* *copyright (c) 2016, *all Rights reserved, School of computer and Control engineering, Yantai University. * File name: Main.cpp * Author: Chang Heng * Date of Completion: May 2, 2016 * version number: v1.0 * * Problem Description: a circle (Circle) class is derived from the point base, the data member R (RADIUS) is added, and the member function area of the space is calculated, Implement other required member functions, design the main function to complete the test; * Input Description: No * Output description: Output as required */#include <iostream> #include <cmath> #define PI 3.14using Namespace Std;class point{public:point (double m,double n); void Pointshow ();p rivate:double x; Double y;}; Point::P oint (double m,double n) {x=m; Y=n;} void point::p ointshow () {cout<<) the center coordinates are: "<<endl; cout<<x<< "" <<y<<endl;} Class Circle:public point{public:circle (double m,double n,int R2); void area (); void Circleshow ();p rivate:int R;}; Circle::circle (double m,double n,int R2):P oint (m,n) {r=r2;} void Circle::area () {double S; S=pi*r*r; cout<< "The area of the circle is:" <<S<<ENDL;} void Circle::circleshow () {pointshow ();} int main () {double x1,y1; int R1; cout<< "Please enter center coordinates:" <<endl; Cin>>x1>>y1; cout<< "Please enter the radius of the circle:" <<endl; cin>>r1; Circle c (X1,Y1,R1); C.circleshow (); C.area ();}
11th Week "Project 1-point-circle-cylinder Group Design 2"