-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.h
More file actions
77 lines (69 loc) · 1.82 KB
/
Book.h
File metadata and controls
77 lines (69 loc) · 1.82 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
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef BOOK_H
#define BOOK_H
#include <iostream>
#include <string>
#include <vector>
#include <stdlib.h>
#include "Time.h"
using namespace std;
/*
This class is a container object called Book. The Library holds these books,
and they are exchanged among accounts.
*/
class Book
{
public:
//Constructors
Book(){};
Book(string title, string author, string genre);
Book(vector<string> Bookinfo);
Book(int ID, int DueDate, int numRenew);
//Prints short info of book
void PrintBookDataShort();
//Prints full info of book
void PrintBookDataFull();
//Prints formatted full info of book
void PrintBookDataFullIndent();
//Prints if book is available or who it is checked out by
void PrintStatus();
//returns file line format of book info
string outputBook();
//returns file line format of checked out book info
string outputCheckedoutBooks();
//returns true if book is overdue
bool is_Overdue();
//Renews book if possible
void renew();
//Resets book info
void refresh();
//Adds to popularity score
void addPopularity(){PopularityScore++;}
//Mutator Functions: sets private memeber variables
void setBookID(int num);
void setCheckOutStatus(bool checkout);
void setDueDate(int days){TimeUntilReturn=days;}
void setRenewTimes(int num){Renewed=num;}
void setBorrowerID(int id){BorrowerID=id;}
//Accessor Functions: returns private member variables
int getBookID() const;
int getBorrowerID()const{return BorrowerID;}
int getPopularity() const;
string getAuthor() const;
string getTitle() const;
string getGenre() const;
int getDueDate() const{return TimeUntilReturn;}
int getRenewed() const{return Renewed;};
bool getCheckedOutStatus() const;
private:
int BookID;
int TimeUntilReturn;
int PopularityScore;
int Renewed;
int BorrowerID;
string Title;
string Author;
string Genre;
bool checkedOut;
bool Overdue;
};
#endif