diff options
Added work from today's practice
1 files changed, 30 insertions, 0 deletions
| -rw-r--r-- | Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex2/Prize.h | 30 |
diff --git a/Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex2/Prize.h b/Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex2/Prize.h new file mode 100644 index 0000000..6b68613 --- /dev/null +++ b/Year 1/Object-oriented Programming/12-Practice-17.05.2022/ex2/Prize.h @@ -0,0 +1,30 @@ +#include <fstream> +#include <iostream> + +class Prize { +protected: + unsigned money; + unsigned points; + +public: + Prize(unsigned price, unsigned points) { + this->money = price; + this->points = points; + } + virtual void vizualize() const = 0; +}; + + +void print(const char* fileName) { + std::ifstream file(fileName); + if (!file.is_open()) return; + + char buffer[1024]; + while (!file.eof()) { + file.read(buffer, 1024); + std::cout << buffer; + } + std::cout << std::endl; + file.close(); +} + |
