📄 reader.cpp
字号:
#include "Reader.h"
#include<string>
using namespace std;
CReader::CReader( int ID,
char phone[],
char name[],
char password[],
bool sex ){
iID = ID;
strcpy(sPhone, phone);
strcpy(sName, name);
strcpy(sPassword, password);
bSex = sex;
iBorrowNum = 0;
}
bool CReader::CheckID( int id ){ //检查帐号
if(iID == id)return true;
else return false;
}
/*
CReader::Get_phone(char *p) //取电话
{
strcpy(phone,p);
}
CReader::Get_password(char *pass)//取密码
{
strcpy(password,pass);
}
*/
bool CReader::ChePas(char *pas)// const //检测密码??
{
if ( strcmp( sPassword ,pas )==0 )return true;
else return false;
/*
int n=0;
//打开文件,我不知道怎么搞啊
while( strcmp( sPassword ,pas) == 0 || n<=3)
{
if( strcmp(sPassword,pas)==0)
{
cout<<"密码正确!!!"<<endl;
break;
}
else
cout<<"密码不正确!!!重新输入!!"<<endl;
n++;
}
*/
}
bool CReader::Borrow_book(CBook book){ //借书成功true,失败false
if(iBorrowNum == 10)return false;
// cout<<"借书已满,请先还书!!!"<<endl;
else{
book.Lend();
BookOnHand[iBorrowNum++] = book;
}
}
CReader::Reback_book(CBook book){ //??
book.Retu();
iBorrowNum--;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -