summaryrefslogtreecommitdiffstats
path: root/Bachelor/Prog2/Prakt2
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
downloadStudium-master.tar.gz
Studium-master.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Bachelor/Prog2/Prakt2')
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/.cdtbuild25
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/.cdtproject18
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/.project19
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.cpp42
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.h26
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Debug/Coffeemachine.d11
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Debug/GeneralDevice.d8
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Debug/Heating.d10
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Debug/Radio.d10
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Debug/SmartHousebin0 -> 847098 bytes
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Debug/main.d15
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Debug/makefile30
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Debug/objects.mk13
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Debug/sources.mk16
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Debug/subdir.mk48
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/GeneralDevice.cpp42
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/GeneralDevice.h28
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Heating.cpp40
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Heating.h26
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp38
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/Radio.h25
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/main.cpp61
-rw-r--r--Bachelor/Prog2/Prakt2/SmartHouse/prg2p2_1.zipbin0 -> 3735 bytes
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/.cdtbuild25
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/.cdtproject18
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/.project19
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Circle.cpp27
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Circle.h18
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Debug/Circle.d10
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Debug/Rectangle.d10
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Debug/Shape.d8
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Debug/Square.d12
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Debug/geomObjbin0 -> 197267 bytes
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Debug/main.d14
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Debug/makefile30
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Debug/objects.mk13
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Debug/sources.mk16
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Debug/subdir.mk48
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Rectangle.cpp25
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Rectangle.h19
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Shape.cpp14
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Shape.h14
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Square.cpp25
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/Square.h18
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/geomObj.zipbin0 -> 2665 bytes
-rw-r--r--Bachelor/Prog2/Prakt2/geomObj/main.cpp39
46 files changed, 973 insertions, 0 deletions
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/.cdtbuild b/Bachelor/Prog2/Prakt2/SmartHouse/.cdtbuild
new file mode 100644
index 0000000..6318112
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/.cdtbuild
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 2.1.0?>
+
+<ManagedProjectBuildInfo>
+<project id="SmartHouse.cdt.managedbuild.target.gnu.exe.1040245498" name="Executable (Gnu)" projectType="cdt.managedbuild.target.gnu.exe">
+<configuration id="cdt.managedbuild.config.gnu.exe.debug.240199794" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug" artifactName="SmartHouse" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" cleanCommand="rm -rf">
+<toolChain superClass="cdt.managedbuild.toolchain.gnu.exe.debug" id="cdt.managedbuild.toolchain.gnu.exe.debug.275731498" name="GCC Tool Chain">
+<tool superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug" id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1456875189" name="GCC C Compiler"/>
+<tool superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug" id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.359016985" name="GCC C++ Compiler"/>
+<tool superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug" id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.1893305652" name="GCC C Linker"/>
+<tool superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug" id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.725660303" name="GCC C++ Linker"/>
+<tool superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug" id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1626310915" name="GCC Assembler"/>
+</toolChain>
+</configuration>
+<configuration id="cdt.managedbuild.config.gnu.exe.release.1801815739" name="Release" parent="cdt.managedbuild.config.gnu.exe.release" artifactName="SmartHouse" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" cleanCommand="rm -rf">
+<toolChain superClass="cdt.managedbuild.toolchain.gnu.exe.release" id="cdt.managedbuild.toolchain.gnu.exe.release.402764758" name="GCC Tool Chain">
+<tool superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release" id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.1034718652" name="GCC C Compiler"/>
+<tool superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release" id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.484912643" name="GCC C++ Compiler"/>
+<tool superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release" id="cdt.managedbuild.tool.gnu.c.linker.exe.release.1269000869" name="GCC C Linker"/>
+<tool superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release" id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.456112124" name="GCC C++ Linker"/>
+<tool superClass="cdt.managedbuild.tool.gnu.assembler.exe.release" id="cdt.managedbuild.tool.gnu.assembler.exe.release.1332270129" name="GCC Assembler"/>
+</toolChain>
+</configuration>
+</project>
+</ManagedProjectBuildInfo>
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/.cdtproject b/Bachelor/Prog2/Prakt2/SmartHouse/.cdtproject
new file mode 100644
index 0000000..aecd7f1
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/.cdtproject
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.managedbuilder.core.managedMake">
+<extension point="org.eclipse.cdt.core.ScannerInfoProvider" id="org.eclipse.cdt.managedbuilder.core.ManagedBuildManager"/>
+<extension point="org.eclipse.cdt.core.BinaryParser" id="org.eclipse.cdt.core.ELF"/>
+<data>
+<item id="cdt_indexer">
+<indexEnabled indexValue="true"/>
+<indexerProblemsEnabled indexProblemsValue="7"/>
+</item>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"/>
+</item>
+</data>
+</cdtproject>
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/.project b/Bachelor/Prog2/Prakt2/SmartHouse/.project
new file mode 100644
index 0000000..58e9156
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/.project
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>SmartHouse</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ </natures>
+</projectDescription>
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.cpp b/Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.cpp
new file mode 100644
index 0000000..68c6e5e
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.cpp
@@ -0,0 +1,42 @@
+#include "Coffeemachine.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+using std::string;
+//using std::istream;
+using std::ostream;
+
+Coffeemachine::Coffeemachine()
+{
+ numberOfCups=0;
+ cout << "Konstruktor Coffeemachine called" << endl;
+}
+
+Coffeemachine::Coffeemachine(char * devName)
+ :GeneralDevice(devName)
+{
+ numberOfCups=0;
+ cout << "Überladener Konstruktor Coffeemachine called" << endl;
+}
+
+Coffeemachine::~Coffeemachine()
+{
+ cout << "Destruktor Coffeemachine called" << endl;
+}
+
+void Coffeemachine::operator++(int)
+{
+ numberOfCups++;
+}
+
+void Coffeemachine::operator--(int)
+{
+ numberOfCups<=0?numberOfCups=0:numberOfCups--;
+}
+
+void Coffeemachine::print()
+{
+ cout << "Name: " << getDeviceName()
+ << " Cups: " << numberOfCups << endl;
+}
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.h b/Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.h
new file mode 100644
index 0000000..d5d2ac5
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.h
@@ -0,0 +1,26 @@
+#ifndef _COFFEEMACHINE_H_
+#define _COFFEEMACHINE_H_
+
+#include "GeneralDevice.h"
+#include <iostream>
+
+using std::istream;
+using std::ostream;
+
+class Coffeemachine : public GeneralDevice
+{
+ //friend ostream &operator<<( ostream&, const Coffeemachine & );
+
+public:
+ Coffeemachine();
+ Coffeemachine(char *);
+ virtual ~Coffeemachine();
+ virtual void operator++(int);
+ virtual void operator--(int);
+ virtual void print();
+
+private:
+ int numberOfCups;
+};
+
+#endif //_COFFEEMACHINE_H_
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Debug/Coffeemachine.d b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/Coffeemachine.d
new file mode 100644
index 0000000..6148646
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/Coffeemachine.d
@@ -0,0 +1,11 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+Coffeemachine.d ./Coffeemachine.o: ../Coffeemachine.cpp ../Coffeemachine.h \
+ ../GeneralDevice.h
+
+../Coffeemachine.h:
+
+../GeneralDevice.h:
+
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Debug/GeneralDevice.d b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/GeneralDevice.d
new file mode 100644
index 0000000..9c526ae
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/GeneralDevice.d
@@ -0,0 +1,8 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+GeneralDevice.d ./GeneralDevice.o: ../GeneralDevice.cpp ../GeneralDevice.h
+
+../GeneralDevice.h:
+
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Debug/Heating.d b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/Heating.d
new file mode 100644
index 0000000..1b8c962
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/Heating.d
@@ -0,0 +1,10 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+Heating.d ./Heating.o: ../Heating.cpp ../Heating.h ../GeneralDevice.h
+
+../Heating.h:
+
+../GeneralDevice.h:
+
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Debug/Radio.d b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/Radio.d
new file mode 100644
index 0000000..a543cf7
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/Radio.d
@@ -0,0 +1,10 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+Radio.d ./Radio.o: ../Radio.cpp ../Radio.h ../GeneralDevice.h
+
+../Radio.h:
+
+../GeneralDevice.h:
+
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Debug/SmartHouse b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/SmartHouse
new file mode 100644
index 0000000..c4b3586
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/SmartHouse
Binary files differ
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Debug/main.d b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/main.d
new file mode 100644
index 0000000..891f3e9
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/main.d
@@ -0,0 +1,15 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+main.d ./main.o: ../main.cpp ../Coffeemachine.h ../GeneralDevice.h ../Heating.h \
+ ../Radio.h
+
+../Coffeemachine.h:
+
+../GeneralDevice.h:
+
+../Heating.h:
+
+../Radio.h:
+
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Debug/makefile b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/makefile
new file mode 100644
index 0000000..7e0fccb
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/makefile
@@ -0,0 +1,30 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+ROOT := ..
+
+-include $(ROOT)/makefile.init
+
+RM := rm -rf
+
+# All of the sources participating in the build are defined here
+-include sources.mk
+-include $(SUBDIRS:%=%/subdir.mk)
+-include objects.mk
+-include $(DEPS)
+-include $(ROOT)/makefile.defs
+
+all: SmartHouse
+
+SmartHouse: $(OBJS)
+ @echo 'Building target: $@'
+ g++ -o $@ $(OBJS) $(USER_OBJS) $(LIBS)
+ @echo 'Finished building: $@'
+
+clean:
+ -$(RM) $(OBJS) $(DEPS) SmartHouse
+
+.PHONY: all clean dependents
+
+-include $(ROOT)/makefile.targets
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Debug/objects.mk b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/objects.mk
new file mode 100644
index 0000000..59a3b5b
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/objects.mk
@@ -0,0 +1,13 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+LIBS :=
+USER_OBJS :=
+
+
+OBJS := \
+ $(C_SRCS:$(ROOT)/%.c=%.o) $(C_UPPER_SRCS:$(ROOT)/%.C=%.o) $(CC_SRCS:$(ROOT)/%.cc=%.o) $(CXX_SRCS:$(ROOT)/%.cxx=%.o) $(CPP_SRCS:$(ROOT)/%.cpp=%.o) $(S_SRCS:$(ROOT)/%.s=%.o) $(S_UPPER_SRCS:$(ROOT)/%.S=%.o)
+
+DEPS := \
+ $(C_SRCS:$(ROOT)/%.c=%.d) $(C_UPPER_SRCS:$(ROOT)/%.C=%.d) $(CC_SRCS:$(ROOT)/%.cc=%.d) $(CXX_SRCS:$(ROOT)/%.cxx=%.d) $(CPP_SRCS:$(ROOT)/%.cpp=%.d) $(S_SRCS:$(ROOT)/%.s=%.d) $(S_UPPER_SRCS:$(ROOT)/%.S=%.d) \ No newline at end of file
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Debug/sources.mk b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/sources.mk
new file mode 100644
index 0000000..357bfc1
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/sources.mk
@@ -0,0 +1,16 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+C_SRCS :=
+C_UPPER_SRCS :=
+CC_SRCS :=
+CXX_SRCS :=
+CPP_SRCS :=
+S_SRCS :=
+S_UPPER_SRCS :=
+
+# Every subdirectory with source files must be described here
+SUBDIRS := \
+. \
+
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Debug/subdir.mk b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/subdir.mk
new file mode 100644
index 0000000..b0df7bd
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Debug/subdir.mk
@@ -0,0 +1,48 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+S_UPPER_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+CPP_SRCS += \
+${addprefix $(ROOT)/, \
+Coffeemachine.cpp \
+GeneralDevice.cpp \
+Heating.cpp \
+Radio.cpp \
+main.cpp \
+}
+
+CC_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+C_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+C_UPPER_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+CXX_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+S_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+# Each subdirectory must supply rules for building sources it contributes
+%.o: $(ROOT)/%.cpp
+ @echo 'Building file: $<'
+ @echo g++ -O0 -g3 -Wall -c -fmessage-length=0 -o$@ $<
+ @g++ -O0 -g3 -Wall -c -fmessage-length=0 -o$@ $< && \
+ echo -n $(@:%.o=%.d) $(dir $@) > $(@:%.o=%.d) && \
+ g++ -MM -MG -P -w -O0 -g3 -Wall -c -fmessage-length=0 $< >> $(@:%.o=%.d)
+ @echo 'Finished building: $<'
+ @echo ' '
+
+
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/GeneralDevice.cpp b/Bachelor/Prog2/Prakt2/SmartHouse/GeneralDevice.cpp
new file mode 100644
index 0000000..738051e
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/GeneralDevice.cpp
@@ -0,0 +1,42 @@
+#include "GeneralDevice.h"
+#include <string>
+#include <iostream>
+
+using std::cout;
+using std::endl;
+using std::istream;
+using std::ostream;
+using std::string;
+
+ostream &operator<<( ostream& outstream, GeneralDevice &GenDev)
+{
+ GenDev.print();
+ return outstream;
+}
+
+GeneralDevice::GeneralDevice()
+{
+ cout << "Konstruktor GeneralDevice called" << endl;
+}
+
+GeneralDevice::GeneralDevice(char* devName)
+ :deviceName(devName)
+{
+ cout << "Überladener Konstruktor GeneralDevice called" << endl;
+}
+
+GeneralDevice::~GeneralDevice()
+{
+ cout << "Destruktor GeneralDevice called" << endl;
+}
+
+string GeneralDevice::getDeviceName()
+{
+ //cout << deviceName;
+ return deviceName;
+}
+
+void GeneralDevice::setDeviceName(string devName)
+{
+ deviceName=devName;
+}
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/GeneralDevice.h b/Bachelor/Prog2/Prakt2/SmartHouse/GeneralDevice.h
new file mode 100644
index 0000000..44512f2
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/GeneralDevice.h
@@ -0,0 +1,28 @@
+#ifndef _GENERALDEVICE_H_
+#define _GENERALDEVICE_H_
+
+#include <string>
+#include <iostream>
+
+//using std::istream;
+using std::ostream;
+using std::string;
+
+class GeneralDevice
+{
+friend ostream &operator<<( ostream&, GeneralDevice &);
+
+public:
+ GeneralDevice();
+ GeneralDevice(char *);
+ virtual ~GeneralDevice();
+ virtual void operator++(int) =0;
+ virtual void operator--(int) =0;
+ string getDeviceName();
+ void setDeviceName(string);
+ virtual void print()=0;
+private:
+ string deviceName;
+};
+
+#endif //_GENERALDEVICE_H_
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Heating.cpp b/Bachelor/Prog2/Prakt2/SmartHouse/Heating.cpp
new file mode 100644
index 0000000..1669848
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Heating.cpp
@@ -0,0 +1,40 @@
+#include "Heating.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+using std::string;
+
+Heating::Heating()
+{
+ temperature=0;
+ cout << "Konstruktor Heating called" << endl;
+}
+
+Heating::Heating(char * devName)
+ : GeneralDevice(devName)
+{
+ temperature=0;
+ cout << "Überladener Konstruktor Heating called" << endl;
+}
+
+Heating::~Heating()
+{
+ cout << "Destruktor Heating called" << endl;
+}
+
+void Heating::operator++(int)
+{
+ temperature++;
+}
+
+void Heating::operator--(int)
+{
+ temperature<=0?temperature=0:temperature--;
+}
+
+void Heating::print()
+{
+ cout << "Name: " << getDeviceName()
+ << " Temperatur: " << temperature << endl;
+}
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Heating.h b/Bachelor/Prog2/Prakt2/SmartHouse/Heating.h
new file mode 100644
index 0000000..d1e5d3c
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Heating.h
@@ -0,0 +1,26 @@
+#ifndef _HEATING_H_
+#define _HEATING_H_
+
+#include "GeneralDevice.h"
+#include <iostream>
+
+//using std::istream;
+using std::ostream;
+
+class Heating : public GeneralDevice
+{
+ //friend ostream &operator<<( ostream&, const Heating& );
+
+public:
+ Heating();
+ Heating(char *);
+ virtual ~Heating();
+ virtual void operator++(int);
+ virtual void operator--(int);
+ virtual void print();
+
+private:
+ float temperature;
+};
+
+#endif //_HEATING_H_
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 <iostream>
+
+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;
+}
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Radio.h b/Bachelor/Prog2/Prakt2/SmartHouse/Radio.h
new file mode 100644
index 0000000..4f839f7
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/Radio.h
@@ -0,0 +1,25 @@
+#ifndef _RADIO_H_
+#define _RADIO_H_
+
+#include "GeneralDevice.h"
+#include <iostream>
+
+//using std::istream;
+using std::ostream;
+
+class Radio : public GeneralDevice
+{
+ //friend ostream &operator<<( ostream&, const Radio& );
+
+public:
+ Radio();
+ Radio(char *);
+ virtual ~Radio();
+ virtual void operator++(int);
+ virtual void operator--(int);
+ virtual void print();
+private:
+ double volume;
+};
+
+#endif //_RADIO_H_
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;
+}
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/prg2p2_1.zip b/Bachelor/Prog2/Prakt2/SmartHouse/prg2p2_1.zip
new file mode 100644
index 0000000..61c418b
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/SmartHouse/prg2p2_1.zip
Binary files differ
diff --git a/Bachelor/Prog2/Prakt2/geomObj/.cdtbuild b/Bachelor/Prog2/Prakt2/geomObj/.cdtbuild
new file mode 100644
index 0000000..e0c01e4
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/.cdtbuild
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 2.1.0?>
+
+<ManagedProjectBuildInfo>
+<project id="geomObj.cdt.managedbuild.target.gnu.exe.438729764" name="Executable (Gnu)" projectType="cdt.managedbuild.target.gnu.exe">
+<configuration id="cdt.managedbuild.config.gnu.exe.debug.63593985" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug" artifactName="geomObj" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" cleanCommand="rm -rf">
+<toolChain superClass="cdt.managedbuild.toolchain.gnu.exe.debug" id="cdt.managedbuild.toolchain.gnu.exe.debug.2094845" name="GCC Tool Chain">
+<tool superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug" id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1451406840" name="GCC C Compiler"/>
+<tool superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug" id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1170301199" name="GCC C++ Compiler"/>
+<tool superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug" id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.2024820330" name="GCC C Linker"/>
+<tool superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug" id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.320388229" name="GCC C++ Linker"/>
+<tool superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug" id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1476595339" name="GCC Assembler"/>
+</toolChain>
+</configuration>
+<configuration id="cdt.managedbuild.config.gnu.exe.release.634623059" name="Release" parent="cdt.managedbuild.config.gnu.exe.release" artifactName="geomObj" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" cleanCommand="rm -rf">
+<toolChain superClass="cdt.managedbuild.toolchain.gnu.exe.release" id="cdt.managedbuild.toolchain.gnu.exe.release.1631051032" name="GCC Tool Chain">
+<tool superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release" id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.379225803" name="GCC C Compiler"/>
+<tool superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release" id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.498605140" name="GCC C++ Compiler"/>
+<tool superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release" id="cdt.managedbuild.tool.gnu.c.linker.exe.release.532531920" name="GCC C Linker"/>
+<tool superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release" id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.1998885769" name="GCC C++ Linker"/>
+<tool superClass="cdt.managedbuild.tool.gnu.assembler.exe.release" id="cdt.managedbuild.tool.gnu.assembler.exe.release.1741496889" name="GCC Assembler"/>
+</toolChain>
+</configuration>
+</project>
+</ManagedProjectBuildInfo>
diff --git a/Bachelor/Prog2/Prakt2/geomObj/.cdtproject b/Bachelor/Prog2/Prakt2/geomObj/.cdtproject
new file mode 100644
index 0000000..82c36e0
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/.cdtproject
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.managedbuilder.core.managedMake">
+<extension point="org.eclipse.cdt.core.ScannerInfoProvider" id="org.eclipse.cdt.managedbuilder.core.ManagedBuildManager"/>
+<extension point="org.eclipse.cdt.core.BinaryParser" id="org.eclipse.cdt.core.ELF"/>
+<data>
+<item id="cdt_indexer">
+<indexEnabled indexValue="true"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"/>
+</item>
+</data>
+</cdtproject>
diff --git a/Bachelor/Prog2/Prakt2/geomObj/.project b/Bachelor/Prog2/Prakt2/geomObj/.project
new file mode 100644
index 0000000..166cc9d
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/.project
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>geomObj</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ </natures>
+</projectDescription>
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Circle.cpp b/Bachelor/Prog2/Prakt2/geomObj/Circle.cpp
new file mode 100644
index 0000000..14415bf
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Circle.cpp
@@ -0,0 +1,27 @@
+#include "Circle.h"
+
+const double pi = 3.14159265358979;
+
+Circle::Circle()
+ :radius(.0)
+{
+}
+
+Circle::Circle(double newR)
+ :radius(newR)
+{
+}
+
+Circle::~Circle()
+{
+}
+
+double Circle::getArea()
+{
+ return (radius * radius * pi);
+}
+
+double Circle::getCircumference()
+{
+ return (2 * radius * pi);
+}
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Circle.h b/Bachelor/Prog2/Prakt2/geomObj/Circle.h
new file mode 100644
index 0000000..580b254
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Circle.h
@@ -0,0 +1,18 @@
+#ifndef _CIRCLE_H_
+#define _CIRCLE_H_
+
+#include "Shape.h"
+
+class Circle : public Shape
+{
+public:
+ Circle();
+ Circle(double);
+ virtual ~Circle();
+ virtual double getArea();
+ virtual double getCircumference();
+private:
+ const double radius;
+};
+
+#endif //_CIRCLE_H_
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Debug/Circle.d b/Bachelor/Prog2/Prakt2/geomObj/Debug/Circle.d
new file mode 100644
index 0000000..61b13d0
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Debug/Circle.d
@@ -0,0 +1,10 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+Circle.d ./Circle.o: ../Circle.cpp ../Circle.h ../Shape.h
+
+../Circle.h:
+
+../Shape.h:
+
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Debug/Rectangle.d b/Bachelor/Prog2/Prakt2/geomObj/Debug/Rectangle.d
new file mode 100644
index 0000000..3cca9be
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Debug/Rectangle.d
@@ -0,0 +1,10 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+Rectangle.d ./Rectangle.o: ../Rectangle.cpp ../Rectangle.h ../Shape.h
+
+../Rectangle.h:
+
+../Shape.h:
+
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Debug/Shape.d b/Bachelor/Prog2/Prakt2/geomObj/Debug/Shape.d
new file mode 100644
index 0000000..3ca796d
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Debug/Shape.d
@@ -0,0 +1,8 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+Shape.d ./Shape.o: ../Shape.cpp ../Shape.h
+
+../Shape.h:
+
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Debug/Square.d b/Bachelor/Prog2/Prakt2/geomObj/Debug/Square.d
new file mode 100644
index 0000000..15e7998
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Debug/Square.d
@@ -0,0 +1,12 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+Square.d ./Square.o: ../Square.cpp ../Square.h ../Rectangle.h ../Shape.h
+
+../Square.h:
+
+../Rectangle.h:
+
+../Shape.h:
+
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Debug/geomObj b/Bachelor/Prog2/Prakt2/geomObj/Debug/geomObj
new file mode 100644
index 0000000..809ba37
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Debug/geomObj
Binary files differ
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Debug/main.d b/Bachelor/Prog2/Prakt2/geomObj/Debug/main.d
new file mode 100644
index 0000000..b5a4438
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Debug/main.d
@@ -0,0 +1,14 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+main.d ./main.o: ../main.cpp ../Rectangle.h ../Shape.h ../Circle.h ../Square.h
+
+../Rectangle.h:
+
+../Shape.h:
+
+../Circle.h:
+
+../Square.h:
+
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Debug/makefile b/Bachelor/Prog2/Prakt2/geomObj/Debug/makefile
new file mode 100644
index 0000000..698fd9d
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Debug/makefile
@@ -0,0 +1,30 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+ROOT := ..
+
+-include $(ROOT)/makefile.init
+
+RM := rm -rf
+
+# All of the sources participating in the build are defined here
+-include sources.mk
+-include $(SUBDIRS:%=%/subdir.mk)
+-include objects.mk
+-include $(DEPS)
+-include $(ROOT)/makefile.defs
+
+all: geomObj
+
+geomObj: $(OBJS)
+ @echo 'Building target: $@'
+ g++ -o $@ $(OBJS) $(USER_OBJS) $(LIBS)
+ @echo 'Finished building: $@'
+
+clean:
+ -$(RM) $(OBJS) $(DEPS) geomObj
+
+.PHONY: all clean dependents
+
+-include $(ROOT)/makefile.targets
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Debug/objects.mk b/Bachelor/Prog2/Prakt2/geomObj/Debug/objects.mk
new file mode 100644
index 0000000..59a3b5b
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Debug/objects.mk
@@ -0,0 +1,13 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+LIBS :=
+USER_OBJS :=
+
+
+OBJS := \
+ $(C_SRCS:$(ROOT)/%.c=%.o) $(C_UPPER_SRCS:$(ROOT)/%.C=%.o) $(CC_SRCS:$(ROOT)/%.cc=%.o) $(CXX_SRCS:$(ROOT)/%.cxx=%.o) $(CPP_SRCS:$(ROOT)/%.cpp=%.o) $(S_SRCS:$(ROOT)/%.s=%.o) $(S_UPPER_SRCS:$(ROOT)/%.S=%.o)
+
+DEPS := \
+ $(C_SRCS:$(ROOT)/%.c=%.d) $(C_UPPER_SRCS:$(ROOT)/%.C=%.d) $(CC_SRCS:$(ROOT)/%.cc=%.d) $(CXX_SRCS:$(ROOT)/%.cxx=%.d) $(CPP_SRCS:$(ROOT)/%.cpp=%.d) $(S_SRCS:$(ROOT)/%.s=%.d) $(S_UPPER_SRCS:$(ROOT)/%.S=%.d) \ No newline at end of file
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Debug/sources.mk b/Bachelor/Prog2/Prakt2/geomObj/Debug/sources.mk
new file mode 100644
index 0000000..357bfc1
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Debug/sources.mk
@@ -0,0 +1,16 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+C_SRCS :=
+C_UPPER_SRCS :=
+CC_SRCS :=
+CXX_SRCS :=
+CPP_SRCS :=
+S_SRCS :=
+S_UPPER_SRCS :=
+
+# Every subdirectory with source files must be described here
+SUBDIRS := \
+. \
+
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Debug/subdir.mk b/Bachelor/Prog2/Prakt2/geomObj/Debug/subdir.mk
new file mode 100644
index 0000000..f9a4a41
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Debug/subdir.mk
@@ -0,0 +1,48 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+S_UPPER_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+CPP_SRCS += \
+${addprefix $(ROOT)/, \
+Circle.cpp \
+Rectangle.cpp \
+Shape.cpp \
+Square.cpp \
+main.cpp \
+}
+
+CC_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+C_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+C_UPPER_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+CXX_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+S_SRCS += \
+${addprefix $(ROOT)/, \
+}
+
+# Each subdirectory must supply rules for building sources it contributes
+%.o: $(ROOT)/%.cpp
+ @echo 'Building file: $<'
+ @echo g++ -O0 -g3 -Wall -c -fmessage-length=0 -o$@ $<
+ @g++ -O0 -g3 -Wall -c -fmessage-length=0 -o$@ $< && \
+ echo -n $(@:%.o=%.d) $(dir $@) > $(@:%.o=%.d) && \
+ g++ -MM -MG -P -w -O0 -g3 -Wall -c -fmessage-length=0 $< >> $(@:%.o=%.d)
+ @echo 'Finished building: $<'
+ @echo ' '
+
+
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Rectangle.cpp b/Bachelor/Prog2/Prakt2/geomObj/Rectangle.cpp
new file mode 100644
index 0000000..cc48ae2
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Rectangle.cpp
@@ -0,0 +1,25 @@
+#include "Rectangle.h"
+
+Rectangle::Rectangle()
+ :sideA(.0),sideB(.0)
+{
+}
+
+Rectangle::~Rectangle()
+{
+}
+
+Rectangle::Rectangle(double newA, double newB)
+ :sideA(newA),sideB(newB)
+{
+}
+
+double Rectangle::getCircumference()
+{
+ return 2 * (sideA + sideB);
+}
+
+double Rectangle::getArea()
+{
+ return sideA*sideB;
+}
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Rectangle.h b/Bachelor/Prog2/Prakt2/geomObj/Rectangle.h
new file mode 100644
index 0000000..586110a
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Rectangle.h
@@ -0,0 +1,19 @@
+#ifndef _RECTANGLE_H_
+#define _RECTANGLE_H_
+
+#include "Shape.h"
+
+class Rectangle : public Shape
+{
+public:
+ Rectangle();
+ Rectangle(double,double);
+ virtual ~Rectangle();
+ virtual double getArea();
+ virtual double getCircumference();
+private:
+ const double sideA;
+ const double sideB;
+};
+
+#endif //_RECTANGLE_H_
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Shape.cpp b/Bachelor/Prog2/Prakt2/geomObj/Shape.cpp
new file mode 100644
index 0000000..8eb43e5
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Shape.cpp
@@ -0,0 +1,14 @@
+#include "Shape.h"
+
+Shape::Shape()
+{
+}
+
+Shape::~Shape()
+{
+}
+
+double Shape::operator-(Shape* toSub)
+{
+ return (this->getArea() - toSub->getArea());
+}
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Shape.h b/Bachelor/Prog2/Prakt2/geomObj/Shape.h
new file mode 100644
index 0000000..481c2be
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Shape.h
@@ -0,0 +1,14 @@
+#ifndef _SHAPE_H_
+#define _SHAPE_H_
+
+class Shape
+{
+public:
+ Shape();
+ virtual ~Shape();
+ virtual double getCircumference() = 0;
+ virtual double getArea() = 0;
+ double operator-(Shape*);
+};
+
+#endif //_SHAPE_H_
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Square.cpp b/Bachelor/Prog2/Prakt2/geomObj/Square.cpp
new file mode 100644
index 0000000..3bd6682
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Square.cpp
@@ -0,0 +1,25 @@
+#include "Square.h"
+
+Square::Square()
+ :length(.0)
+{
+}
+
+Square::Square(double newlength)
+:length(newlength)
+{
+}
+
+Square::~Square()
+{
+}
+
+double Square::getArea()
+{
+ return length*length;
+}
+
+double Square::getCircumference()
+{
+ return 2 * (length + length);
+}
diff --git a/Bachelor/Prog2/Prakt2/geomObj/Square.h b/Bachelor/Prog2/Prakt2/geomObj/Square.h
new file mode 100644
index 0000000..022483b
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/Square.h
@@ -0,0 +1,18 @@
+#ifndef _SQUARE_H_
+#define _SQUARE_H_
+
+#include "Rectangle.h"
+
+class Square : public Rectangle
+{
+public:
+ Square();
+ Square(double);
+ virtual ~Square();
+ virtual double getCircumference();
+ virtual double getArea();
+private:
+ const double length;
+};
+
+#endif //_SQUARE_H_
diff --git a/Bachelor/Prog2/Prakt2/geomObj/geomObj.zip b/Bachelor/Prog2/Prakt2/geomObj/geomObj.zip
new file mode 100644
index 0000000..cad5044
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/geomObj.zip
Binary files differ
diff --git a/Bachelor/Prog2/Prakt2/geomObj/main.cpp b/Bachelor/Prog2/Prakt2/geomObj/main.cpp
new file mode 100644
index 0000000..e81de02
--- /dev/null
+++ b/Bachelor/Prog2/Prakt2/geomObj/main.cpp
@@ -0,0 +1,39 @@
+#include <iostream>
+#include "Rectangle.h"
+#include "Circle.h"
+#include "Square.h"
+
+using std::cout;
+using std::endl;
+
+int main()
+{
+ Circle circle(15.0);
+ Rectangle rectangle(3.0,4.0);
+ Square square(4.2);
+
+ int n,j;
+
+ Shape* ptrArray[3];
+
+ ptrArray[0]=&circle;
+ ptrArray[1]=&rectangle;
+ ptrArray[2]=&square;
+
+ for (n=0;n<3;n++)
+ {
+ cout << "Area: "<< (ptrArray[n]->getArea()) << " Circumference: "
+ << (ptrArray[n]->getCircumference()) << endl;
+ }
+
+ for (n=0;n<3;n++)
+ {
+ for (j=0;j<3;j++)
+ {
+ cout << "Difference: "
+ << (ptrArray[j]->getArea() - ptrArray[n]->getArea()) << endl;
+ }
+ }
+
+ return 0;
+}