From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp (limited to 'Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp') diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp b/Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp new file mode 100644 index 0000000..6cbc24b --- /dev/null +++ b/Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp @@ -0,0 +1,38 @@ +#include "Radio.h" +#include + +using std::cout; +using std::endl; + +Radio::Radio() +{ + volume=0; + cout << "Konstruktor Radio called" << endl; +} + +Radio::Radio(char * devName) + :GeneralDevice(devName) +{ + volume=0; + cout << "Überladener Konstruktor Radio called" << endl; +} + +Radio::~Radio() +{ + cout << "Destruktor Radio called" << endl; +} + +void Radio::operator++(int) +{ + volume++; +} + +void Radio::operator--(int) +{ + volume<=0?volume=0:volume--; +} + +void Radio::print() +{ + cout << "Name: "<< getDeviceName() << " Volume: " << volume << endl; +} -- cgit v1.2.3