}
return type;
int get_money(){ }
int get_count(){ }
return count; return money;
private:string name;//持卡人姓名 } ;
void StuCard::pay(){
if (type==1 ) {
money-=2; count=count+1;
cout<<\你的卡余额为:\
//StuCard stucard1(char name[16],char ID[17],int money,int type,int count); string id;//卡号
int money;//余额
int type;//卡的类型 (type=1,学生卡;type=2,教师卡;type=3,限制卡) int count; //乘车次数
if(money<5)
cout<<\你的余额过低,请及时充值!\ }
if(type==2) {
count=count+1;
cout<<\你的卡余额为:\
if(money<5)
cout<<\你的余额过低,请及时充值!\ }
if(type==3) {
if (count<20){
count=count+1;
cout<<\你的卡余额为:\
if(money<5)
cout<<\你的余额过低,请及时充值!\
}
if (count==20){
count=count+1;
cout<<\这是本学期内最后一次免费乘车!\\n\
cout<<\你的卡余额为:\
if(money<5)
cout<<\你的余额过低,请及时充值!\
}
if (count>20){
cout<<\本次开始收费!\\n\money-=2; count=count+1;
cout<<\你的卡余额为:\
if(money<5)
cout<<\你的余额过低,请及时充值!\
}
}
}
int StuCard::GetRest(){ }
void StuCard::show() { }
StuCard::StuCard(string name,string id,int money,int type,int count){ }
//People
class People{
string name; string sex; this->name=name; this->id=id;
this->money=money; this->type=type; this->count=count;
cout<<\名字:\cout<<\卡的类型:\cout<<\乘车次数:\
return money;
string work; string office; string number;
public: };
People::People(string n,string s,string w,string o,string b) { }
void People::readPeople() {
cout<<\请输入姓名:\cin>>name;
cout<<\请输入性别:\cin>>sex;
cout<<\请输入职务:\name=n; sex=s; work=w; office=o; number=b;
People(string n,string s,string w,string o,string b); void readPeople();
void show(string name,string sex,string work,string office,string number); void addPeople(); void deletePeople();
string get_name(){return name;} string get_sex(){return sex;} string get_work(){return work;} string get_office(){return office;} string get_number(){return number;}
}
cin>>work;
cout<<\请输入所属单位:\cin>>office; if(work==\学生\{ } else { }
cout<<\请输入工号:\cin>>number;
cout<<\请输入学号:\cin>>number;
void People::addPeople()//定义添加持卡人函数 {
People people1(\实例化对象 ofstream fileout(\打开文件 if(!fileout) { } else {
cout<<\请输入持卡人基本信息:\
cout<<\不能打开文件!\
people1.readPeople();//读入信息 cout< fileout< ple1.get_office()