From 945f7e67d6ca8047c961457786fac5e2d9a13d82 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 3 Apr 2026 18:17:51 +0300 Subject: feat(Week07): Add solutions --- Week07/Exercise01/Book.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Week07/Exercise01/Book.h (limited to 'Week07/Exercise01/Book.h') diff --git a/Week07/Exercise01/Book.h b/Week07/Exercise01/Book.h new file mode 100644 index 0000000..eaddaea --- /dev/null +++ b/Week07/Exercise01/Book.h @@ -0,0 +1,39 @@ +#ifndef _BOOK +#define _BOOK + +#include "String.h" + +class Book { + String title; + String author; + short year; + String text; + double price; + bool availableForPurchase; + +public: + void SetTitle(const String& newTitle); + const String& GetTitle() const; + + void SetAuthor(const String& newAuthor); + const String& GetAuthor() const; + + void SetYear(short newYear); + short GetYear() const; + + void SetText(const String& newText); + const String& GetText() const; + + void SetPrice(double newPrice); + double GetPrice() const; + + void SetAvailableForPurchase(bool isAvailableForPurchase); + bool GetAvailableForPurchase() const; + + void PrintBookInfo() const; + + bool Export(const String& fileName); + bool Import(const String& fileName); +}; + +#endif /* _BOOK */ -- cgit v1.3.1-23-gd82d