From f7ed9a8a6c31b17d54d2f37cc0f12b64f8e4b6d2 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 22 Apr 2024 13:52:55 +0300 Subject: [w9] Added exercise descriptions and solution to exam 1 --- week09/Exam1/Drone.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 week09/Exam1/Drone.h (limited to 'week09/Exam1/Drone.h') 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); +}; -- cgit v1.2.3