C++ Primer Plus
碰碰狗
计算机专业在读学生
展开
-
10---1
//BankAccount.h #ifndef BANKACCOUNT_H #define BANKACCOUNT_H #include<string> class BankAccount { private: std::string name; std::string account; double deposit; public: BankAccount(); BankAccount(const std::string& n, const std::string&am.原创 2022-04-25 21:18:54 · 238 阅读 · 0 评论 -
10---2
//Person.h #ifndef PERSON_H #define PERSON_H #include<string> class Person { private: std::string lname; std::string fname; public: Person(); Person(const std::string& ln, const std::string& fn = "Heyyou"); void Show()const; void For.原创 2022-04-25 20:31:49 · 90 阅读 · 0 评论 -
10---3
代码】10---3。原创 2022-08-04 16:26:31 · 66 阅读 · 0 评论 -
10---6
//Move.h #ifndef MOVE_H #define MOVE_H class Move { private: double x; double y; public: Move(); Move(double a, double b = 0.0); void showmove()const; Move add(const Move& m)const; void reset(double a = 0.0, double b = 0.0); }; #endif // !MO.原创 2022-04-27 21:49:21 · 215 阅读 · 0 评论 -
10---7
//Plorg.h #ifndef PLORG_H #define PLORG_H #include<string> class Plorg { private: std::string name; int CI; public: Plorg(); Plorg(const std::string& n, int C = 50); ~Plorg(); void show(); void change(int C); }; #endif // !PLORG_H //.原创 2022-04-27 21:03:44 · 227 阅读 · 0 评论 -
11---2
代码】11---2。原创 2022-08-08 16:57:24 · 62 阅读 · 0 评论 -
11---4
//Time.h #ifndef TIME_H #define TIME_H class Time { private: int hours; int minutes; public: Time(); Time(int h, int m = 0); friend Time operator+ (const Time& t1, const Time& t2); friend Time operator- (const Time& t1, const Time&.原创 2022-05-14 20:36:11 · 121 阅读 · 0 评论 -
11---7
//Complex.h #ifndef COMPLEX_H #define COMPLEX_H #include<iostream> class Complex { private: double x; double y; public: Complex(); Complex(double a, double b = 0.0); Complex operator+(const Complex& c)const; Complex operator-(const Com.原创 2022-05-14 21:58:12 · 61 阅读 · 0 评论 -
12---1
//Cow.h #ifndef COW_H #define COW_H #include<iostream> class Cow { private: char name[20]; char* hobby; double weight; public: Cow(); Cow(const char* nm, const char* ho, double wt); Cow(const Cow& c); ~Cow(); Cow& operator=(const .原创 2022-05-19 20:48:52 · 67 阅读 · 0 评论 -
12---2
//String.h #ifndef STRING_H #define STRING_H #include<iostream> using std::ostream; using std::istream; class String { private: char* str; int len; static int num_strings; static const int CINLIM = 80; public: String(); String(const char* s.原创 2022-05-18 17:49:43 · 57 阅读 · 0 评论 -
12---3
//Stock.h #ifndef STOCK_H #define STOCK_H #include<iostream> class Stock { private: char* str; long shares; double share_val; double total_val; static int num_companies; void set_tot() { total_val = shares * share_val; } public: Stock();.原创 2022-05-19 19:57:54 · 61 阅读 · 0 评论 -
13---2
//Cd.h #ifndef CD_H #define CD_H class Cd { private: char* performers; char* label; int selections; double playtime; public: Cd(const char* p = "null", const char* l = "null", int n = 0, double x = 0.0); Cd(const Cd& d); virtual ~Cd(); virtua.原创 2022-05-29 11:11:01 · 58 阅读 · 0 评论 -
13---3
Base class ABC.h //ABC.h #ifndef ABC_H #define ABC_H #include<iostream> class ABC { private: char* label; int rating; protected: char* showLabel()const { return label; } int showRating()const { return rating; } public: ABC(const char* l = "原创 2022-05-29 16:40:11 · 67 阅读 · 0 评论 -
13---4
Base class Port.h #ifndef PORT_H #define PORT_H #include<iostream> class Port { private: char* brand; char style[20]; int bottles; public: Port(const char* br = "none", const char* st = "none", int b = 0); Port(const Port& p); virtual原创 2022-05-29 18:13:01 · 111 阅读 · 1 评论