This repository was archived by the owner on Dec 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.h
More file actions
65 lines (60 loc) · 1.69 KB
/
Copy pathBook.h
File metadata and controls
65 lines (60 loc) · 1.69 KB
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
#ifndef BOOK_H
#define BOOK_H
#include <iostream>
#include <vector>
#include <stdlib.h>
using std::cout;
using std::string;
using std::cin;
using std::endl;
using std::vector;
class Book{
public:
//Create book with necessary
//information in vector
Book(vector<string> vect);
//Different forms of printing
//Book depending on the request
//From the Interface
void PrintBook() const;
void PrintBookFromUser() const;
void PrintBookFromBrowse() const;
//Resets the Books User dependent information
void returnBook();
//Provided with the Users information,
//Changes the books User dependent data
void changeBookStatus(vector<int> bookInfo);
void addToScore(){popScore++;}
//When User borrows a book, it passes
//Information to the Book to change
//Its User dependent data
void setBorrowID(const int id){borrowID= id;}
void setAvailability(bool avail){available = avail;}
void setDueDate(int date){dueDate = date;}
void setRenewCount(int numTimes){numTimeRenewed = numTimes;}
//Get Info from Book
int getAccountID() const {return borrowID;}
int getID() const {return id;}
int getDueDate() const {return dueDate;}
int getRenewCount() const {return numTimeRenewed;}
string getTitle() const {return title;}
string getAuthor() const {return author;}
string getGenre() const {return genre;}
int getScore() const {return popScore;}
bool getAvailability() const {return available;}
private:
//Basic book information
string title;
string author;
int id;
string genre;
int popScore;
bool available;
//Upon borrowing, book keeps
//Track of who borrowed it
//It's duedate and renewal count
int borrowID;
int dueDate;
int numTimeRenewed;
};
#endif