-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbook.cpp
107 lines (60 loc) · 1.49 KB
/
book.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#include <iostream>
#include <string>
//#include "book.h"
//#include "LibraryItem.h"
#include "book.h"
using namespace std;
Book::Book() {
//bookID = 0;
//cost = 0;
//title = "NoName";
//author = "NoAuthur";
//cat = "NoCat";
//isbn = 0;
}
//void Book::SetBookId(int bookID) {
//this->bookID = bookID;
//}
//void Book::SetCost(int cost) {
//this->cost = cost;
//}
void Book::SetTitle(string title) {
this->title=title;
}
void Book::SetAuthor(string author) {
this->author = author;
}
void Book::SetCat(string cat) {
this->cat = cat;
}
void Book::SetIsbn(int isbn) {
this->isbn = isbn;
}
//int Book::GetBookId() {
//return bookID;
//}
//int Book::GetCost() {
//return cost;
//}
string Book::GetTitle() {
return title;
}
string Book::GetAuthor() {
return author;
}
string Book::GetCat() {
return cat;
}
int Book::GetIsbn() {
return isbn;
}
void Book::PrintInfo() {
cout << " BOOK ID #: " << GetId() << " , Cost: $" << GetCost() << " , Max Loan Period: " << GetLoanPeriod() << " , Status: " << GetStatus() << " , Title: ";
cout << GetTitle() << " , Author: " << GetAuthor() << " , Category: " << GetCat() << ", Isbn #: " << GetIsbn() << endl << endl;
}
void Book::PrintRawInfo() {
int t = 1;
ofstream out("items.dat", std::ios_base::app);
out << t << endl << GetId() << endl << GetCost() << endl << GetLoanPeriod() << endl << GetStatus() << endl;
out << GetTitle() << endl << GetAuthor() << endl << GetCat() << endl << GetIsbn() << endl;
}