?? card.cpp
字號:
#include"card.h"
int cishu=0;
//|-----------------|
void bsetpd(bookcard &lei)
{lei.pd=0;}
void rsetpd(bookcard &lei)
{lei.pd=1;}
void judge(bookcard &lei)
{
if(lei.pd)
cout<<"the book "<<lei.bookname<<" is in the library"<<endl;
else
cout<<"the book "<<lei.bookname<<" is not in the library"<<endl;
}
//|-----------------|
void bookcard::setbookcard(CString a,CString b,CTime c,double d,CString e)
{
bookname=a; writername=b; publishtime=c; price=d; publishplace=e;
pd=1;
}
void bookcard::getbook()
{
cout<<"書的信息:"<<endl;
cout<<"\t書名:"<<bookname<<"\t作者:"<<writername<<"\t出版日期:"<<publishtime.Format("%Y,%B,%d");
cout<<"\t價錢:"<<price<<"\t出版地點:"<<publishplace<<endl;
}
void borrowcard::setborrowcard(CString a,CString b,CTime c,char d)
{
personname=a; number=b; burntime=c; sex=d;
}
void borrowcard::getperson()
{
cout<<"借書人的信息:"<<endl;
cout<<"\t人名:"<<personname<<"\t性別:"<<sex<<"\t學號:"<<number<<"\t出生日期:"<< burntime.Format("%Y,%B,%d")<<endl;
}
void recordcard::brecord(CTime a,CString b)
{
cout<<"please input the name of the book you want to borrow"<<endl;
cin>>bookname;
while(strcmp(bookname,"sea")&&strcmp(bookname,"picture"))
{
cout<<"你要找的書不存在。請從新輸入書名,如果輸入三次的書名均不存在,則系統結束"<<endl;
cin>>bookname;
cishu++;
if(cishu==3)
exit(0);
}
cout<<"the book "<<bookname<<" is borrowed"<<endl;
borrowtime=a; personname=b;
}
void recordcard::handle()
{
cout<<"還書時---------------"<<endl;
int year,month,day;
cout<<"please input the time when the book is returned"<<endl;
cin>>year>>month>>day;
returntime=CTime(year,month,day,0,0,0);
CTimeSpan ts=returntime-borrowtime;
cout<<"借書紀錄:"<<endl;
cout<<"\t借書時間:"<<borrowtime.Format("%Y,%B,%d");
cout<<"\t借書人:"<<personname<<"\t書名:"<<bookname<<"\t還書時間:"<<returntime.Format("%Y,%B,%d")<<endl;
cout<<"此書已借"<<ts.GetDays()<<"天"<<endl;
if(ts.GetDays()<=30)
cout<<"在規定時間30天內歸還"<<endl;
else
cout<<"未在規定時間30天內歸還"<<endl;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -