Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / Exam 1 / ex2 / Book.cpp
diff options
context:
space:
mode:
Commit9f61b59ca6ceb76cd634240d118f5771c0534f3d (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-04-20 18:43:21 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-04-20 18:43:21 +0300
Files3fa15098faa79b5df0927e92dae0125c447ac1be /Year 1/Object-oriented Programming/Exam 1/ex2/Book.cpp
uni-projects-9f61b59ca6ceb76cd634240d118f5771c0534f3d.tar
uni-projects-9f61b59ca6ceb76cd634240d118f5771c0534f3d.tar.gz
uni-projects-9f61b59ca6ceb76cd634240d118f5771c0534f3d.zip
Parent26cf424c42f9cdc172191faa5b2d1c1fcf350143 (diff)
Added my work from todays exam
1 files changed, 32 insertions, 0 deletions
-rw-r--r--Year 1/Object-oriented Programming/Exam 1/ex2/Book.cpp32
diff --git a/Year 1/Object-oriented Programming/Exam 1/ex2/Book.cpp b/Year 1/Object-oriented Programming/Exam 1/ex2/Book.cpp
new file mode 100644
index 0000000..c487e41
--- /dev/null
+++ b/Year 1/Object-oriented Programming/Exam 1/ex2/Book.cpp
@@ -0,0 +1,32 @@
+#include "Book.h"
+#include <cstring>
+
+Book::Book()
+{}
+
+Book::Book(const char* name, const char* author, unsigned count) {
+ this->set_name(name);
+ this->set_author(author);
+ this->set_count(count);
+}
+
+const char* Book::get_name() const {
+ return this->name;
+}
+void Book::set_name(const char* newName) {
+ strcpy(this->name, newName);
+}
+
+const char* Book::get_author() const {
+ return this->author;
+}
+void Book::set_author(const char* newAuthor) {
+ strcpy(this->author, newAuthor);
+}
+
+unsigned Book::get_count() const {
+ return this->count;
+}
+void Book::set_count(unsigned newCount) {
+ this->count = newCount;
+}