-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.cpp
More file actions
89 lines (73 loc) · 1.6 KB
/
Book.cpp
File metadata and controls
89 lines (73 loc) · 1.6 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
78
79
80
81
82
83
84
85
86
87
88
89
/*
Lisa Lin (lisalin@my.unt.edu)
Homework 3 Assignment - Library Management System
Started: 3/12/2021
Book entity cpp file
*/
#include "Book.h"
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;
Book::Book() {
this->author = "";
this->title = "";
this->id = 0;
this->isbn = 0;
this->cost = 0.0;
this->status = "IN";
}
Book::Book(string author, string title, int id, int isbn, float cost, string status) {
this->author = author;
this->title = title;
this->id = id;
this->isbn = isbn;
this->cost = cost;
this->status = status;
}
void Book::setAuthor(string bookAuthor) {
this->author = bookAuthor;
}
string Book::getAuthor(){
return author;
}
void Book::setTitle(string bookTitle){
this->title = bookTitle;
}
string Book::getTitle(){
return title;
}
void Book::setID(int bookID){
this->id = bookID;
}
int Book::getID() {
return id;
}
void Book::setIsbn(int bookISBN) {
this->isbn = bookISBN;
}
int Book::getIsbn() {
return isbn;
}
void Book::setCost(float bookCost) {
this->cost = bookCost;
}
float Book::getCost(){
return cost;
}
void Book::setStatus(string bookStatus){
this->status = bookStatus;
}
string Book::getStatus(){
return status;
}
void Book::printBook() {
cout << endl << "-------------" << endl;
cout << "Title: " << title << endl;
cout << "Author: " << author << endl;
cout << "Library ID: " << id << endl;
cout << "ISBN: " << isbn << endl;
cout << fixed << setprecision(2);
cout << "Cost: $" << cost << endl;
cout << "Status: " << status << endl;
}