📄 book.h
字号:
#ifndef BOOK_H
#define BOOK_H
#include<iostream.h>
class book
{
// friend class readerhistory ;
public:
book()
{
condition = true ;//图书入库时,状态初始化为真,表示图书在馆
}
void set() //输入书籍资料
{
cout<<"请输入书籍编号:";
cin>>code;
cout<<"请输入书籍名称:";
cin>>name;
}
void setcondition( bool a )
{
condition = a ;
}
int getcode()
{
return code ;
}
char* getname()
{
return name ;
}
bool getcondition()
{
return condition ;
}
void print()
{
cout<<"书籍编号:"<<code<<endl;
cout<<"书籍名称:"<<name<<endl;
cout<<"书籍状态:" ;
if( condition == true)
cout << "在馆" << endl ;
else
cout << "借出" << endl ;
}
private:
int code ; //书籍编号
char name[10]; //书籍名称
bool condition ; //图书的状态
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -