From 90f96d499c6db58b0c3c96bc142a1c3c64b9e82e Mon Sep 17 00:00:00 2001 From: pi5fnqcfr <824659727@qq.com> Date: Tue, 4 Jun 2024 22:01:55 +0800 Subject: [PATCH] ADD file via upload --- Book.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Book.cpp diff --git a/Book.cpp b/Book.cpp new file mode 100644 index 0000000..924be86 --- /dev/null +++ b/Book.cpp @@ -0,0 +1,47 @@ +#include "Book.h" + +Book::Book(string bookname, Date data, bool bookislead, int times) +{ + this->BookName = bookname; + this->Data = data; + this->BookIsLend = bookislead; + this->Times = times; +} + +void Book::ShowInfo() +{ + cout << "<<" << this->BookName << ">>" << endl; + if (!this->BookIsLend) { + cout << "状态:" << "在库" << endl; + } + else { + cout << "状态:" << "借出" << endl;//借出图书输出借出时间 + cout << "借出时间:" << this->Data.ShowDate() << endl; + } + cout << "借出次数:" << this->Times << endl; + cout << endl; +} + +void Book::Show_LoanTime() +{ + cout << "借出时间:" << this->Data.ShowDate() << endl; +} + +void Book::inTurnout()//在借出操作中使用_pstu1替换后,不需要再使用这个函数 +{ + if (this->BookIsLend == false) { + this->BookIsLend = true; + } +} + +void Book::outTurnin() +{ + if (this->BookIsLend == true) { + this->BookIsLend = false; + } +} + +void Book::addTimes() +{ + this->Times += 1; +}