summaryrefslogtreecommitdiffstats
path: root/Bachelor/Prog2/Prakt2/SmartHouse/main.cpp
diff options
context:
space:
mode:
authorSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
committerSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
commit33613a85afc4b1481367fbe92a17ee59c240250b (patch)
tree670b842326116b376b505ec2263878912fca97e2 /Bachelor/Prog2/Prakt2/SmartHouse/main.cpp
downloadStudium-master.tar.gz
Studium-master.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Bachelor/Prog2/Prakt2/SmartHouse/main.cpp')
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/main.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/main.cpp b/Bachelor/Prog2/Prakt2/SmartHouse/main.cpp
new file mode 100644
index 0000000..eadd146
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/main.cpp
@@ -0,0 +1,61 @@
+#include <iostream>
+#include "Coffeemachine.h"
+#include "Heating.h"
+#include "Radio.h"
+#include "GeneralDevice.h"
+
+using std::cin;
+using std::cout;
+using std::endl;
+using std::string;
+
+int main()
+{
+ GeneralDevice *actualDevice;
+ GeneralDevice *array[5];
+
+ char input;
+
+ Heating htog("Heizung OG");
+ Heating hteg("Heizung EG");
+ Coffeemachine cm("Tchibo KM 3");
+ Radio radw("Radio Wohnzimmer");
+ Radio radk("Radio Küche");
+
+ array[0]=&cm;
+ array[1]=&radw;
+ array[2]=&radk;
+ array[3]=&htog;
+ array[4]=&hteg;
+
+ actualDevice=array[0];
+
+ cout << "SmartHouse" << endl;
+
+ do
+ {
+ cout << "+ : laut/warm/mehr" << endl;
+ cout << "- : leise/kalt/weniger" << endl;
+ cout << "1 : Tchibo KM 3"<<endl;
+ cout << "2 : Radio Wohnzimmer"<<endl;
+ cout << "3 : Radio Küche"<<endl;
+ cout << "4 : Heizung OG"<<endl;
+ cout << "5 : Heizung EG"<<endl;
+ cout << "? : Übersicht"<<endl;
+ cout << "0 : aus"<<endl;
+ //input=cin.get();
+ cin >> input;
+ switch (input) {
+ case '1':actualDevice=array[0]; break;
+ case '2':actualDevice=array[1]; break;
+ case '3':actualDevice=array[2]; break;
+ case '4':actualDevice=array[3]; break;
+ case '5': actualDevice=array[4]; break;
+ case '+': (*actualDevice)++; break;
+ case '-': (*actualDevice)--; break;
+ case '?': cout << *actualDevice; break;
+ }
+ }while (input!='0');
+
+ return 0;
+}