diff options
| author | Syndamia <kamen@syndamia.com> | 2024-04-22 13:52:55 +0300 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2024-04-22 13:52:55 +0300 |
| commit | f7ed9a8a6c31b17d54d2f37cc0f12b64f8e4b6d2 (patch) | |
| tree | 866abf46779f63a2fd1c8cfc70f7ff5f3bc11752 /week09/Exam1/Drone.h | |
| parent | a2e284b0056075e2365deaa2455be567c3b3c945 (diff) | |
| download | oop-2023-solutions-f7ed9a8a6c31b17d54d2f37cc0f12b64f8e4b6d2.tar oop-2023-solutions-f7ed9a8a6c31b17d54d2f37cc0f12b64f8e4b6d2.tar.gz oop-2023-solutions-f7ed9a8a6c31b17d54d2f37cc0f12b64f8e4b6d2.zip | |
[w9] Added exercise descriptions and solution to exam 1
Diffstat (limited to 'week09/Exam1/Drone.h')
| -rw-r--r-- | week09/Exam1/Drone.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/week09/Exam1/Drone.h b/week09/Exam1/Drone.h new file mode 100644 index 0000000..a45cceb --- /dev/null +++ b/week09/Exam1/Drone.h @@ -0,0 +1,34 @@ +// Помощна структура за метода moveWithOneStep +struct Coordinate { + double x; + double y; +}; + +class Drone { + // +0.25 За член данни + char* id; + char generatedPath[64]; + // Валидна интерпретация е position да бъде индекс, нищо не му противоречи + int position; + + // +1.25 За голяма петица + void free(); + void copyFrom(const Drone& other); +public: + Drone(); + ~Drone(); + Drone(const Drone& other); + Drone& operator=(const Drone& other); + Drone(Drone&& other); + Drone& operator=(Drone&& other); + + // +0.50 За метод + void printGeneratedPath(); + // +0.50 За метод + Coordinate moveWithOneStep(); + + // Помощна за 2.2, метод play + Coordinate positionAndMove(); + // Помощна за 3.1 + Drone(const char* id, char generatedPath[64], int position); +}; |
