aboutsummaryrefslogtreecommitdiff
path: root/week07/Exercise5.h
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2024-04-04 20:11:12 +0300
committerSyndamia <kamen@syndamia.com>2024-04-04 20:11:12 +0300
commita2e284b0056075e2365deaa2455be567c3b3c945 (patch)
tree8a842d1f2ffb9f00989b39d2ab7a7ade1a858d81 /week07/Exercise5.h
parent44d085f265583f0e3cbef294bbe2c8e300aaa452 (diff)
downloadoop-2023-solutions-a2e284b0056075e2365deaa2455be567c3b3c945.tar
oop-2023-solutions-a2e284b0056075e2365deaa2455be567c3b3c945.tar.gz
oop-2023-solutions-a2e284b0056075e2365deaa2455be567c3b3c945.zip
[w7] Added exercise descriptions and solutions
Diffstat (limited to 'week07/Exercise5.h')
-rw-r--r--week07/Exercise5.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/week07/Exercise5.h b/week07/Exercise5.h
new file mode 100644
index 0000000..f588efa
--- /dev/null
+++ b/week07/Exercise5.h
@@ -0,0 +1,26 @@
+class TransportTicket {
+ unsigned id;
+ char* source;
+ char* destination;
+ float price;
+
+ void free();
+ void copyFrom(const TransportTicket& other);
+
+public:
+ TransportTicket(unsigned id, const char* source, const char* destination, float price);
+ void Print();
+
+ TransportTicket();
+ ~TransportTicket();
+ TransportTicket(const TransportTicket& other);
+ TransportTicket& operator=(const TransportTicket& other);
+ TransportTicket(TransportTicket&& other);
+ TransportTicket& operator=(TransportTicket&& other);
+
+ void SaveText(const char* fileName);
+ void LoadText(const char* fileName);
+
+ void SaveBinary(const char* fileName);
+ void LoadBinary(const char* fileName);
+};