📄 associator.h
字号:
#ifndef flag1
#define flag1
#include"book.h"
using namespace std;
class customer
{
public:
customer(){}
customer(string n,long i);
customer(string n,long i,book b[]);
void SetName(string n);
void SetId(long i);
string GetName();
long GetId();
book GetBook(int i);
virtual void PrintInfo()=0;
void PrintBooks();
protected:
string name;
long id;
book books[20];
};
customer::customer(string n,long i)
{
name=n;
id=i;
}
customer::customer(string n,long i,book b[])
{
name=n;
id=i;
int j;
for(j=0;j<sizeof(b);j++)
{
books[j]=b[j];
}
}
book customer::GetBook(int i)
{
return(books[i]);
}
void customer::SetName(string n)
{
name=n;
}
void customer::SetId(long i)
{
id=i;
}
string customer::GetName()
{
return(name);
}
long customer::GetId()
{
return(id);
}
void customer::PrintBooks()
{
int i;
for(i=0;i<sizeof(books);i++)
{
books[i].print();
}
}
class Associator:public customer
{
public:
Associator(){}
Associator(string n,long i,int p);
Associator(string n,long i,int p,book b[]);
void SetPoint(int p);
int GetPoint();
void PrintInfo();
private:
int point;
};
Associator::Associator(string n,long i,int p):customer(n,i)
{
point=p;
}
Associator::Associator(string n,long i,int p,book b[]):customer(n,i,b)
{
point=p;
}
void Associator::SetPoint(int p)
{
point=p;
}
int Associator::GetPoint()
{
return(point);
}
void Associator::PrintInfo()
{
//////////////////////
}
class tempcustomer:public customer
{
public:
tempcustomer(string n,long i,book b[]);
void PrintInfo();
};
tempcustomer::tempcustomer(string n,long i,book b[]):customer(n,i,b)
{
}
void tempcustomer::PrintInfo()
{
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -