西电软件学院c++上机实验报告(3)

2019-04-10 08:47

}

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()


西电软件学院c++上机实验报告(3).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:图像处理常用命令matlab

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: