-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.cpp
More file actions
30 lines (26 loc) · 1.15 KB
/
Copy pathBook.cpp
File metadata and controls
30 lines (26 loc) · 1.15 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
/**
* @file Book.cpp
* @author Sam Emison + Cole Belew
* @date 2024-11-07
* @brief Storage for Books
* .
* Provides the actual commands for getting the book data and storing it
*/
#include "Book.h"
//Constructor
Book::Book(const std::string& title, const std::string& author, int pages, const std::string& isbn, float coverPrice, int year)
: title(title), author(author), pages(pages), isbn(isbn), coverPrice(coverPrice), year(year) {}
//Getters
std::string Book::getTitle() const { return title; }
std::string Book::getAuthor() const { return author; }
int Book::getPages() const { return pages; }
std::string Book::getISBN() const { return isbn; }
float Book::getCoverPrice() const { return coverPrice; }
int Book::getYear() const { return year; }
//Setters
void Book::setTitle(const std::string& title) { this->title = title; }
void Book::setAuthor(const std::string& author) { this->author = author; }
void Book::setPages(int pages) { this->pages = pages; }
void Book::setISBN(const std::string& isbn) { this->isbn = isbn; }
void Book::setCoverPrice(float coverPrice) { this->coverPrice = coverPrice; }
void Book::setYear(int year) { this->year = year; }