设计Dog类 代码参考】的更多相关文章

#include <iostream> #include <string> using namespace std; class Dog { private: string name; int age; char sex; double weight; public: void GetName(){cin>>name;return;} void GetAge(){cin>>age;return;} void GetSex(){cin>>sex;r…
#include <iostream> #include <string> using namespace std; class Dog { private: string name; int age; char sex; double weight; public: Dog(string,int,char,double); void GetName(){cin>>name;return;} void GetAge(){cin>>age;return;} v…
#include <iostream> using namespace std; class Trapezium { private: int x1,y1,x2,y2,x3,y3,x4,y4; public: void initial(){x1=,x2=;x3=;x4=;y1=;y2=;y3=;y4=;return;} void GetPosition(int&,int&,int&,int&,int&,int&,int&,int&…
#include <iostream> #include <cstdio> using namespace std; class MyTime { private: int hour; int minute; int second; public: void SetTime(){cin>>hour>>minute>>second;return;} void print_12(); void print_24(); }; void MyTime::…
#include <iostream> using namespace std; class Weekday { private: int num; public: void SetDay(){cin>>num;return;} void IncDay(){num+=;if(num>) num-=;return;} void NowDay() { switch(num) { case :cout<<"星期日"<<endl;break…
#include <iostream> #include <cstdio> using namespace std; class MyTime { private: int hour; int minute; int second; public: MyTime(){hour=;minute=;second=;} MyTime(int,int,int); void Register(int,int,int); void Show_12(); void Show_24(); void…
#include <iostream> using namespace std; class Trapezium { private: int x1,y1,x2,y2,x3,y3,x4,y4; public: void initial(){x1=,x2=;x3=;x4=;y1=;y2=;y3=;y4=;return;} void GetPosition(int&,int&,int&,int&,int&,int&,int&,int&…
#include <iostream> #include <cstring> using namespace std; class Person { private: char Name[]; char Sex; int Age; public: void Register(char *name, int age, char sex); void ShowMe(); }; void Person::Register(char *name, int age, char sex) {…
#include <iostream> #include <cstring> using namespace std; class Point { private: int x,y; public: Point(int,int); void SetPoint(int,int); int GetX(){return x;} int GetY(){return y;} void Print(); }; class Circle:public Point { private: doubl…
#include <iostream> #include <cstring> using namespace std; class Person { protected: char Name[]; char Sex; int Age; public: void Register(char *name, int age, char sex); void ShowMe(); }; class Teacher:public Person { private: char Dept[]; i…