From c1a310e69933035fb385f52275e9b80cdad695fc Mon Sep 17 00:00:00 2001 From: Angel Dimitriev Date: Tue, 24 May 2022 19:38:22 +0300 Subject: Add files via upload --- Sem. 13/Farm/Cat.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Sem. 13/Farm/Cat.cpp (limited to 'Sem. 13/Farm/Cat.cpp') diff --git a/Sem. 13/Farm/Cat.cpp b/Sem. 13/Farm/Cat.cpp new file mode 100644 index 0000000..4bb833a --- /dev/null +++ b/Sem. 13/Farm/Cat.cpp @@ -0,0 +1,12 @@ +#include "Cat.h" + +void Cat::sayHello() const +{ + std::cout << "Hello, I am a Cat!" << std::endl; +} + +Animal* Cat::clone() const +{ + Animal* newObj = new Cat(*this); //copy constr of Mouse + return newObj; +} \ No newline at end of file -- cgit v1.3.1-23-gd82d