summaryrefslogtreecommitdiffstats
path: root/Bachelor/Prog1/Prakt6
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/Prog1/Prakt6
downloadStudium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.gz
Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Bachelor/Prog1/Prakt6')
-rw-r--r--Bachelor/Prog1/Prakt6/index.htm249
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_1/frozenm.cpp30
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_1/frozenm.h31
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_1/main.cpp25
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_1/microwave.h30
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_1/mircowave.cpp41
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_1/prg1p6_1.dsp116
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_1/prg1p6_1.dsw29
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_2/main.cpp15
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_2/prg1p6_2.dsp108
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_2/prg1p6_2.dsw29
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_2/tictactoe.cpp385
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_2/tictactoe.h36
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_3/Int40.h55
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_3/int40.cpp344
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp74
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_3/prg1p6_3.dsp108
-rw-r--r--Bachelor/Prog1/Prakt6/prg1p6_3/prg1p6_3.dsw29
18 files changed, 1734 insertions, 0 deletions
diff --git a/Bachelor/Prog1/Prakt6/index.htm b/Bachelor/Prog1/Prakt6/index.htm
new file mode 100644
index 0000000..03c361b
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/index.htm
@@ -0,0 +1,249 @@
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<title>Praktikum 6</title>
+</head>
+
+<body>
+
+<table BORDER CELLSPACING=0 WIDTH="100%" >
+<caption>&nbsp;</caption>
+
+<tr>
+<td WIDTH="25%" BGCOLOR="#EFEFDE">FH Darmstadt&nbsp;
+<br>FB Informatik&nbsp;
+<br>Prof.Dr. H.P.Weber</td>
+
+<td>
+<center><font size="+3">Programmieren I&nbsp;</font>
+<br><font size=+3>Praktikum</font></center>
+</td>
+
+<td WIDTH="25%" BGCOLOR="#EFEFDE">
+<center><font size=+4>6</font></center>
+</td>
+</tr>
+</table>
+
+<br>
+<table border WIDTH="100%" >
+<tr VALIGN=TOP>
+<td>Ziel:</td><td>
+Sie sollen problemangepasste Datentypen als Klassen entwerfen und ein
+ Anwendungsprogramm als System aus Objekten implementieren k&ouml;nnen.&nbsp;
+</td>
+</tr>
+</table>
+
+<br>
+<table BORDER="1" CELLSPACING=0 WIDTH="100%" height="608" >
+<tr>
+<td COLSPAN = "2" height="60">
+<h3 ALIGN = "left">
+<b>1&nbsp;&nbsp;&nbsp; Erwärmen eines Tiefkühlgerichts in einer Mikrowelle
+</b>
+</h3>
+
+Realisieren Sie eine Klasse <i>Microwave</i> sowie eine Klasse <i>FrozenMeal</i>:&nbsp;
+</td>
+</tr>
+
+<tr>
+<td WIDTH="370" height="269">
+<table BORDER COLS=1 BGCOLOR="#EFEFDE" ALIGN="center">
+<tr>
+<td>
+<center><b>Microwave</b></center>
+</td>
+</tr>
+
+<tr>
+<td>- power : int&nbsp;
+<br>- volume : int
+<br>- period : double</td>
+</tr>
+
+<tr>
+<td><i>Constructor</i>(a certain volume)&nbsp;
+<br><i>Destructor</i>()
+<br>+ morePower() : void
+<br>+ lessPower() : void
+<br>+ setPeriod(a certain period) : void&nbsp;
+<br>+ heatMeal(a certain FrozenMeal) : void
+<br>+ getPower() : int
+<br>+ getPeriod() : double</td>
+</tr>
+</table>
+</td>
+
+<td WIDTH="400" height="269">
+<table BORDER="1" COLS=1 BGCOLOR="#EFEFDE" ALIGN="center">
+<tr>
+<td>
+<center><b>FrozenMeal</b></center>
+</td>
+</tr>
+
+<tr>
+<td>- name : char* (or string)
+<br>- volume : int
+<br>- temperature : double
+<br>- coeffizient : double</td>
+</tr>
+
+<tr>
+<td><i>Constructor</i>(a certain name, a certain volume)&nbsp;
+<br><i>Destructor</i>()
+<br>+ changeTemperature(a certain temperature) : void
+<br>+ getName() : char* (or string)
+<br>+ getVolume() : int
+<br>+ getCoeffizient() : double
+<br>+ getTemperature() : double</td>
+</tr>
+</table>
+</td>
+</tr>
+
+<td COLSPAN = "2" height="267">
+<br>
+Besonderheiten der Methoden sind:
+<ul>
+<li>
+Durch morePower() und lessPower() soll die Leistung im Bereich
+von minimal 200 W bis maximal 1000 W in Schritten von 200 W ge&auml;ndert
+werden.</li>
+
+<li>
+Das Erw&auml;rmen eines Gerichtes wird durch folgenden Zusammenhang beschrieben:<br>
+Temperatur = Anfangstemperatur + ( Koeffizient * Leistung * Zeitdauer
+/ Volumen)</li>
+
+<li>
+Als Erw&auml;rmungskoeffizient soll der Wert f&uuml;r Wasser verwendet
+werden: Koeffizient = 0.24 cm<sup>3</sup> * Grad / Ws.</li>
+
+<li>
+Achten Sie auf die Einheiten: am einfachsten ist es, wenn Volumen von Mikrowelle
+und Tiefkühlgericht&nbsp;in cm<sup>3</sup> vom Anwendungsprogramm übernommen
+werden.</li>
+
+<li>
+Beim Erzeugen soll ein Tiefk&uuml;hlgericht eine Temperatur von -18 Grad
+haben.</li>
+
+<li>
+Die Destruktoren sollen den Endzustand des jeweiligen Objektes am Bildschirm
+ausgeben.</li>
+
+<li>
+Keine Methode der beiden Klassen liest irgendwelche Daten von Tastatur ein oder
+gibt etwas auf den Bildschirm aus. Dafür ist allein das Anwendungsprogramm
+zuständig.</li>
+ </ul>
+<p>Realisieren Sie zum Testen Ihrer Klassen ein <b>Anwendungsprogramm</b>, das mit verschiedenen
+Tiefk&uuml;hlgerichten und einer geeigneten Mikrowelle die vorhandenen Methoden benutzt.
+</td>
+
+</table>
+
+<br>
+
+<table BORDER="1" CELLSPACING=0 WIDTH="100%" >
+<tr>
+<td>
+<h3>
+<b>2&nbsp;&nbsp;&nbsp; Tic-Tac-Toe</b></h3>
+
+<p>Entwickeln Sie einen Datentyp <font face="Courier New"><b>TicTacToe</b></font>,
+der es ermöglicht ein vollständiges Programm zum Spielen von Tic-Tac-Toe zu
+schreiben.
+<ul>
+<li>Die Klasse <font face="Courier New"><b>TicTacToe</b></font> soll als <b><font face="Courier New">private</font></b>
+ Attribut
+ ein <b><font face="Courier New">char</font></b>-Array mit neun Elementen enthalten.
+</li>
+<li>
+Der Konstruktor soll ein leeres Spielfeld initialisieren.
+</li>
+<li>
+Die <font face="Courier New"><b>public</b></font> Methode <font face="Courier New"><b>playOneGame</b></font>
+soll den Ablauf eines Tic-Tac-Toe-Spieles realisieren. Dabei soll sie
+verschiedene <b><font face="Courier New">private</font></b> Methoden aufrufen,
+die die verschiedenen Teilaufgaben während des Spielablaufs (Eingaben,
+Ausgaben, Ermitteln eines Siegers, Realisierung einer Strategie für die
+Computerzüge) erledigen.
+</li>
+<li>
+Das Spiel soll für zwei Spieler realisiert werden, wobei der Computer einen der
+beiden Spieler spielt. Der menschliche Spieler soll aussuchen können, ob er
+erster oder zweiter Spieler ist.Wenn der erste
+Spieler zieht, soll ein <b><font face="Courier New">X</font></b> in das
+entsprechende Kästchen gesetzt werden, wenn der zweite Spieler zieht, soll ein <b><font face="Courier New">O</font></b>
+in das entsprechende Kästchen gesetzt werden. Es darf nur in ein leeres
+Kästchen gezogen werden.
+</li>
+<li>
+Nach jedem Zug soll bestimmt werden, ob ein Spieler gewonnen hat oder ob das
+Spiel unentschieden endete.
+</li>
+</ul>
+
+</td>
+</tr>
+</table>
+
+<br>
+
+<table BORDER="1" CELLSPACING=0 WIDTH="100%" >
+<tr>
+<td>
+<h3>
+<b>3&nbsp;&nbsp;&nbsp; Große Integer-Zahlen (fakultativ)</b></h3>
+
+<p>Entwickeln Sie einen Datentyp <font face="Courier New"><b>Integer40</b></font>,
+der ein Array mit 40 Elementen benutzt, um ganze Zahlen mit bis zu 40 Dezimalstellen zu
+speichern.
+<ul>
+<li>Implemetieren Sie die Methoden <b><font face="Courier New">read</font></b>,
+<b><font face="Courier New">write</font></b>, <font face="Courier New"><b>add</b></font>,
+<font face="Courier New"><b>subtract</b></font>.
+</li>
+<li>
+Für den Vergleich von <font face="Courier New"><b>Integer40</b></font>-Objekten
+sollen die Methoden <font face="Courier New"><b>isEqual</b></font>, <font face="Courier New"><b>isNotEqual</b></font>,
+<font face="Courier New"><b>isGreaterThan</b></font>, <font face="Courier New"><b>
+isSmallerThan</b></font>,
+<font face="Courier New"><b>isGreaterOrEqual</b></font>,
+<font face="Courier New"><b>isSmallerOrEqual</b></font>
+zur Verfügung stehen. Jede dieser Methoden ist eine Prädikat-Funktion, die <font face="Courier New"><b>true</b></font>
+zurückgibt, wenn die entsprechende Beziehung zwischen zwei Objekten stimmt und <font face="Courier New"><b>false</b></font>,
+wenn sie nicht stimmt. Realisieren Sie außerdem eine Prädikat-Funktion <font face="Courier New"><b>
+isZero</b></font>.
+</li>
+</ul>
+<p>Testen Sie Ihre Klasse in einem <b>Anwendungsprogramm</b>, das die
+vorhandenen Operationen mit geeignet gewählten <font face="Courier New"><b>Integer40</b></font>-Objekten
+ausführt.
+</td>
+</tr>
+</table>
+
+<br>
+
+<table BORDER="1" CELLSPACING=0 WIDTH="100%" >
+<tr>
+<td>
+<h3>
+4<b>&nbsp;&nbsp;&nbsp; Übungsklausur (fakultativ)</b></h3>
+<p>
+Als Klausurvorbereitung können Sie die <a href="PG1Klaus.htm">PG 1-Klausur vom letzten Jahr</a> bearbeiten.
+Am besten halten Sie sich dabei auch schon an die <a href="Hinweise.pdf">allgemeinen Hinweise</a>, die Sie
+bei der Klausur am 10.02.05 beachten müssen.</table>
+
+<br>&nbsp;
+
+</body>
+</html> \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_1/frozenm.cpp b/Bachelor/Prog1/Prakt6/prg1p6_1/frozenm.cpp
new file mode 100644
index 0000000..07b7dfd
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_1/frozenm.cpp
@@ -0,0 +1,30 @@
+// Programmieren 1, Praktikum 6, Aufgabe 1
+// Author: Sven Eisenhauer
+// Date: 13.01.2005
+// File: frozenm.cpp
+// Description: Implementation of class FrozenMeal
+
+#include "frozenm.h"
+#include "microwave.h"
+#include <iostream>
+using std::cout;
+using std::endl;
+
+FrozenMeal::FrozenMeal(string mealname, int vol) {
+ name=mealname;
+ volume=vol;
+ temperature=-18.0;
+ coefficient=.24;
+ cout << endl << "Constructor of class FrozenMeal for object " << mealname;
+}
+
+FrozenMeal::~FrozenMeal()
+{
+ cout << endl << "Destructor of class FrozenMeal for object " << name
+ << ", Temperature: "<< temperature;
+}
+
+void FrozenMeal::changeTemperature(double &temp)
+{
+ temperature=temp;
+} \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_1/frozenm.h b/Bachelor/Prog1/Prakt6/prg1p6_1/frozenm.h
new file mode 100644
index 0000000..7631346
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_1/frozenm.h
@@ -0,0 +1,31 @@
+// Programmieren 1, Praktikum 6, Aufgabe 1
+// Author: Sven Eisenhauer
+// Date: 13.01.2005
+// File: frozenm.h
+// Description: class FrozenMeal
+
+
+
+#ifndef FROZENM_1
+#define FROZENM_1
+
+#include <string>
+using std::string;
+
+class FrozenMeal {
+public:
+ //FrozenMeal(char *, int);
+ FrozenMeal (string, int);
+ ~FrozenMeal();
+ void changeTemperature(double &);
+ string getName() { return name; }
+ int getVolume() { return volume; }
+ double getCoefficient() { return coefficient; }
+ double getTemperature() { return temperature; }
+private:
+ string name;
+ int volume;
+ double temperature;
+ double coefficient;
+};
+#endif \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_1/main.cpp b/Bachelor/Prog1/Prakt6/prg1p6_1/main.cpp
new file mode 100644
index 0000000..6c26572
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_1/main.cpp
@@ -0,0 +1,25 @@
+// Programmieren 1, Praktikum 6, Aufgabe 1
+// Author: Sven Eisenhauer
+// Date: 13.01.2005
+// File: main.cpp
+// Description: Application
+
+#include "frozenm.h"
+#include "microwave.h"
+#include <string>
+
+int main()
+{
+ Microwave micro(22000);
+ FrozenMeal lasagne("Lasagne",200);
+ micro.setPeriod(120.0);
+ micro.morePower();
+ micro.morePower();
+ micro.morePower();
+ micro.heatMeal(lasagne);
+ FrozenMeal something("Something",250);
+ micro.lessPower();
+ micro.setPeriod(180.0);
+ micro.heatMeal(something);
+ return 0;
+}
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_1/microwave.h b/Bachelor/Prog1/Prakt6/prg1p6_1/microwave.h
new file mode 100644
index 0000000..48d0654
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_1/microwave.h
@@ -0,0 +1,30 @@
+// Programmieren 1, Praktikum 6, Aufgabe 1
+// Author: Sven Eisenhauer
+// Date: 13.01.2005
+// File: mircowave.h
+// Description: class microwave
+
+#ifndef MICROW_1
+#define MICROW_1
+
+#include "frozenm.h"
+
+class Microwave {
+
+public:
+ Microwave(int = 20000);
+ ~Microwave();
+ void morePower();
+ void lessPower();
+ void setPeriod(double per) { period=per; }
+ void heatMeal(FrozenMeal &);
+ int getPower() { return power;}
+ double getPeriod() { return period; };
+
+private:
+ int power;
+ int volume;
+ double period;
+};
+
+#endif \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_1/mircowave.cpp b/Bachelor/Prog1/Prakt6/prg1p6_1/mircowave.cpp
new file mode 100644
index 0000000..467a1b3
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_1/mircowave.cpp
@@ -0,0 +1,41 @@
+// Programmieren 1, Praktikum 6, Aufgabe 1
+// Author: Sven Eisenhauer
+// Date: 13.01.2005
+// File: mircowave.cpp
+// Description: Implementation of class microwave
+
+#include "microwave.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+
+Microwave::Microwave(int vol)
+{
+ volume=vol;
+ power=200;
+ cout<<endl<<"Constructor class Mircowave";
+}
+
+Microwave::~Microwave()
+{
+ cout << endl << "Destructor class Mircowave: Power is " << getPower() << " Period is " << getPeriod();
+}
+
+void Microwave::morePower()
+{
+ if (getPower() <= 800)
+ power+=200;
+}
+void Microwave::lessPower()
+{
+ if (getPower() >= 400)
+ power-=200;
+}
+
+void Microwave::heatMeal(FrozenMeal &myMeal)
+{
+ double newTemp=myMeal.getTemperature()+((myMeal.getCoefficient()*getPower()*getPeriod())/myMeal.getVolume());
+ if (myMeal.getVolume() <= volume)
+ myMeal.changeTemperature(newTemp);
+} \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_1/prg1p6_1.dsp b/Bachelor/Prog1/Prakt6/prg1p6_1/prg1p6_1.dsp
new file mode 100644
index 0000000..672fa8b
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_1/prg1p6_1.dsp
@@ -0,0 +1,116 @@
+# Microsoft Developer Studio Project File - Name="prg1p6_1" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=prg1p6_1 - Win32 Debug
+!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
+!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
+!MESSAGE
+!MESSAGE NMAKE /f "prg1p6_1.mak".
+!MESSAGE
+!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
+!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
+!MESSAGE
+!MESSAGE NMAKE /f "prg1p6_1.mak" CFG="prg1p6_1 - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "prg1p6_1 - Win32 Release" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE "prg1p6_1 - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "prg1p6_1 - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x407 /d "NDEBUG"
+# ADD RSC /l 0x407 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "prg1p6_1 - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x407 /d "_DEBUG"
+# ADD RSC /l 0x407 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "prg1p6_1 - Win32 Release"
+# Name "prg1p6_1 - Win32 Debug"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\frozenm.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\main.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\mircowave.cpp
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\frozenm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\microwave.h
+# End Source File
+# End Group
+# Begin Group "Ressourcendateien"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_1/prg1p6_1.dsw b/Bachelor/Prog1/Prakt6/prg1p6_1/prg1p6_1.dsw
new file mode 100644
index 0000000..a809ab7
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_1/prg1p6_1.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN!
+
+###############################################################################
+
+Project: "prg1p6_1"=.\prg1p6_1.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_2/main.cpp b/Bachelor/Prog1/Prakt6/prg1p6_2/main.cpp
new file mode 100644
index 0000000..79ab352
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_2/main.cpp
@@ -0,0 +1,15 @@
+// Programmieren 1, Praktikum 6, Aufgabe 1
+// Author: Sven Eisenhauer
+// Date: 14.01.2005
+// File: main.cpp
+// Description: Application for class TicTacToe
+
+#include "tictactoe.h"
+
+int main()
+{
+ TicTacToe game;
+ game.playOneGame();
+
+ return 0;
+} \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_2/prg1p6_2.dsp b/Bachelor/Prog1/Prakt6/prg1p6_2/prg1p6_2.dsp
new file mode 100644
index 0000000..3a9b49a
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_2/prg1p6_2.dsp
@@ -0,0 +1,108 @@
+# Microsoft Developer Studio Project File - Name="prg1p6_2" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=prg1p6_2 - Win32 Debug
+!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
+!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
+!MESSAGE
+!MESSAGE NMAKE /f "prg1p6_2.mak".
+!MESSAGE
+!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
+!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
+!MESSAGE
+!MESSAGE NMAKE /f "prg1p6_2.mak" CFG="prg1p6_2 - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "prg1p6_2 - Win32 Release" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE "prg1p6_2 - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "prg1p6_2 - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x407 /d "NDEBUG"
+# ADD RSC /l 0x407 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "prg1p6_2 - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x407 /d "_DEBUG"
+# ADD RSC /l 0x407 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "prg1p6_2 - Win32 Release"
+# Name "prg1p6_2 - Win32 Debug"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\main.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\tictactoe.cpp
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\tictactoe.h
+# End Source File
+# End Group
+# Begin Group "Ressourcendateien"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_2/prg1p6_2.dsw b/Bachelor/Prog1/Prakt6/prg1p6_2/prg1p6_2.dsw
new file mode 100644
index 0000000..3b81189
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_2/prg1p6_2.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN!
+
+###############################################################################
+
+Project: "prg1p6_2"=.\prg1p6_2.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_2/tictactoe.cpp b/Bachelor/Prog1/Prakt6/prg1p6_2/tictactoe.cpp
new file mode 100644
index 0000000..0b9693d
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_2/tictactoe.cpp
@@ -0,0 +1,385 @@
+// Programmieren 1, Praktikum 6, Aufgabe 1
+// Author: Sven Eisenhauer
+// Date: 14.01.2005
+// File: tictactoe.cpp
+// Description: Implementation of class TicTacToe
+
+#include "tictactoe.h"
+#include <cstdlib>
+#include <ctime>
+#include <iostream>
+using std::cout;
+using std::endl;
+using std::cin;
+
+TicTacToe::TicTacToe()
+:nrFields(9)
+{
+ for (int i=0;i<nrFields;i++)
+ field[i]=static_cast <char> (i+49);
+ winner="";
+ round=0;
+}
+
+TicTacToe::~TicTacToe()
+{
+ cout << endl << "Game Over!" << endl;
+}
+
+void TicTacToe::eraseField()
+{
+ for (int i=0;i<nrFields;i++)
+ field[i]=' ';
+}
+
+void TicTacToe::playOneGame()
+{
+ srand(time(0));
+ welcome();
+ print();
+ eraseField();
+ setBeginner();
+ print();
+ while (""==getWinner())
+ {
+ if("Player" == getNext())
+ {
+ movePlayer();
+ }
+ else
+ {
+ moveComputer();
+
+ }
+ print();
+ setWinner();
+ }
+ printWinner();
+}
+
+void TicTacToe::print()
+{
+
+ cout << endl;
+ for (int i=0;i<nrFields;i+=3)
+ {
+ cout << field[i] << " | "<< field[i+1]<< " | "<< field[i+2]<<endl;
+ if (i<6)
+ {
+ for (int n=0;n<10;n++)
+ cout << "-";
+ cout << endl;
+ }
+ }
+ cout << endl;
+}
+
+void TicTacToe::welcome()
+{
+ cout << endl << "TicTacToe!" << endl <<
+ "To mark a field, just enter the according number ('1' means field one)!" << endl;
+}
+
+void TicTacToe::setWinner()
+{
+ int n=0;
+
+ while (n<7 && ""==getWinner())
+ {
+ if (0==(n%3))
+ {
+ if (field[n]=='X' &&field[n+1]=='X' &&field[n+2]=='X')
+ winner="Player";
+ if (field[n]=='O' &&field[n+1]=='O' &&field[n+2]=='O')
+ winner="Computer";
+ }
+ if (n<=2)
+ {
+ if (field[n]=='X' &&field[n+3]=='X' &&field[n+6]=='X')
+ winner="Player";
+ if (field[n]=='O' &&field[n+3]=='O' &&field[n+6]=='O')
+ winner="Computer";
+ }
+ if (n==0)
+ {
+ if (field[n]=='X' &&field[n+4]=='X' &&field[n+8]=='X')
+ winner="Player";
+ if (field[n]=='O' &&field[n+4]=='O' &&field[n+8]=='O')
+ winner="Computer";
+ }
+ if (n==2)
+ {
+ if (field[n]=='X' &&field[n+2]=='X' &&field[n+4]=='X')
+ winner="Player";
+ if (field[n]=='O' &&field[n+2]=='O' &&field[n+4]=='O')
+ winner="Computer";
+ }
+ n++;
+ }
+ if (round==nrFields && getWinner()=="")
+ {
+ winner="Draw";
+ }
+}
+
+void TicTacToe::setBeginner()
+{
+ char input;
+ cout << endl << "Who has first move?" << endl
+ << "[P]layer or [C]omputer: ";
+ do
+ {
+ cin >> input;
+ switch (input)
+ {
+ case 'p':
+ case 'P':
+ nextPlayer="Player";
+ break;
+ case 'c':
+ case 'C':
+ nextPlayer="Computer";
+ break;
+ default:
+ cout << endl << "Bad selection! Enter new selection: ";
+ }
+ } while (input!='P' && input!='C' && input!='p' && input!='c');
+}
+void TicTacToe::movePlayer()
+{
+ int draw=0;
+ cout << endl << "Enter your move: ";
+ //print();
+ cin >> draw;
+ while (testField(draw-1))
+ {
+ cout << endl << "Irregular move... please enter a new one" << endl;
+ cin >> draw;
+ }
+ field[draw-1]='X';
+ setNext("Computer");
+ round++;
+}
+
+int TicTacToe::testField(int f)
+{
+ if (field[f]==' ')
+ return 0;
+ else
+ return 1;
+}
+
+void TicTacToe::moveComputer()
+{
+ int move=4;
+ int vertX[3]={0};
+ int horX[3]={0};
+ int diagX[2]={0};
+ int vertO[3]={0};
+ int horO[3]={0};
+ int diagO[2]={0};
+ int n=0,
+ x=0,
+ y=0,
+ d=0;
+
+ if (testField(move))
+ {
+ while(testField(n) && n<nrFields)
+ {
+ n+=2;
+ }
+ move=n;
+ }
+
+ if (testField(move))
+ {
+ n=1;
+ while(testField(n) && n<nrFields)
+ {
+ n+=2;
+ }
+ move=n;
+ }
+
+ //defense
+ for (n=0;n<3;n++)
+ if (field[n]=='X')
+ vertX[0]++;
+ for (n=3;n<6;n++)
+ if (field[n]=='X')
+ vertX[1]++;
+ for (n=6;n<9;n++)
+ if (field[n]=='X')
+ vertX[2]++;
+
+ for (n=0;n<=6;n+=3)
+ if (field[n]=='X')
+ horX[0]++;
+ for (n=1;n<=7;n+=3)
+ if (field[n]=='X')
+ horX[1]++;
+ for (n=2;n<=8;n+=3)
+ if (field[n]=='X')
+ horX[2]++;
+
+ for (n=0;n<=8;n+=4)
+ if (field[n]=='X')
+ diagX[0]++;
+ for (n=2;n<=6;n+=2)
+ if (field[n]=='X')
+ diagX[1]++;
+
+ // offense
+
+ for (n=0;n<3;n++)
+ if (field[n]=='O')
+ vertO[0]++;
+ for (n=3;n<6;n++)
+ if (field[n]=='O')
+ vertO[1]++;
+ for (n=6;n<9;n++)
+ if (field[n]=='O')
+ vertO[2]++;
+
+ for (n=0;n<=6;n+=3)
+ if (field[n]=='O')
+ horO[0]++;
+ for (n=1;n<=7;n+=3)
+ if (field[n]=='O')
+ horO[1]++;
+ for (n=2;n<=8;n+=3)
+ if (field[n]=='O')
+ horO[2]++;
+
+ for (n=0;n<=8;n+=4)
+ if (field[n]=='O')
+ diagO[0]++;
+ for (n=2;n<=6;n+=2)
+ if (field[n]=='O')
+ diagO[1]++;
+
+
+ for (n=0;n<3;n++)
+ if (vertX[n]==2 && vertO[n]==0)
+ {
+ switch(n) {
+ case 0: x=n;
+ while (testField(x) && x<nrFields)
+ x++;
+ break;
+ case 1: x=n+2;
+ while (testField(x) && x<nrFields)
+ x++;
+ break;
+ case 2: x=n+5;
+ while (testField(x) && x<nrFields)
+ x++;
+ break;
+ }
+ move=x;
+ }
+ for (n=0;n<3;n++)
+ if (horX[n]==2 && horO[n]==0)
+ {
+ switch(n) {
+ case 0: y=n;
+ while (testField(y)&& y<nrFields)
+ y+=3;
+ break;
+ case 1: y=n;
+ while (testField(y)&& y<nrFields)
+ y+=3;
+ break;
+ case 2: y=n;
+ while (testField(y)&& y<nrFields)
+ y+=3;
+ break;
+ }
+ move=y;
+ }
+ for (n=0;n<2;n++)
+ if (diagX[n]==2 && diagO[n]==0)
+ {
+ switch(n) {
+ case 0: d=n;
+ while (testField(d)&& d<nrFields)
+ d+=4;
+ break;
+ case 1: d=2;
+ while (testField(d)&& d<nrFields)
+ d+=2;
+ break;
+ }
+ move=d;
+ }
+ for (n=0;n<3;n++)
+ if (vertO[n]==2 && vertX[n]==0)
+ {
+ switch(n) {
+ case 0: x=n;
+ while (testField(x) && x<nrFields)
+ x++;
+ break;
+ case 1: x=n+2;
+ while (testField(x) && x<nrFields)
+ x++;
+ break;
+ case 2: x=n+5;
+ while (testField(x) && x<nrFields)
+ x++;
+ break;
+ }
+ move=x;
+ }
+ for (n=0;n<3;n++)
+ if (horO[n]==2 && horX[n]==0)
+ {
+ switch(n) {
+ case 0: y=n;
+ while (testField(y)&& y<nrFields)
+ y+=3;
+ break;
+ case 1: y=n;
+ while (testField(y)&& y<nrFields)
+ y+=3;
+ break;
+ case 2: y=n;
+ while (testField(y)&& y<nrFields)
+ y+=3;
+ break;
+ }
+ move=y;
+ }
+ for (n=0;n<2;n++)
+ if (diagO[n]==2 && diagX[n]==0)
+ {
+ switch(n) {
+ case 0: d=n;
+ while (testField(d)&& d<nrFields)
+ d+=4;
+ break;
+ case 1: d=2;
+ while (testField(d)&& d<nrFields)
+ d+=2;
+ break;
+ }
+ move=d;
+ }
+
+ cout << endl << "Computer moves: ";
+ field[move]='O';
+ //print();
+ setNext("Player");
+ round++;
+}
+
+void TicTacToe::printWinner()
+{
+ system("cls");
+ if (getWinner()!="Draw")
+ cout << getWinner() << " won the match!" << endl;
+ else
+ cout << "Draw Game, no winner!" << endl;
+ print();
+} \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_2/tictactoe.h b/Bachelor/Prog1/Prakt6/prg1p6_2/tictactoe.h
new file mode 100644
index 0000000..27929e8
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_2/tictactoe.h
@@ -0,0 +1,36 @@
+// Programmieren 1, Praktikum 6, Aufgabe 1
+// Author: Sven Eisenhauer
+// Date: 14.01.2005
+// File: tictactoe.h
+// Description: class TicTacToe
+
+#ifndef TICTACTOE_1
+#define TICTACTOE_1
+
+class TicTacToe
+{
+public:
+ TicTacToe();
+ ~TicTacToe();
+ void playOneGame();
+private:
+ char field[9];
+ const int nrFields;
+ int round;
+ char *nextPlayer;
+ char *winner;
+ void print();
+ void printWinner();
+ void welcome();
+ void setNext(char *n) {nextPlayer=n;}
+ void setBeginner();
+ void setWinner();
+ char * getNext() {return nextPlayer;}
+ char * getWinner() {return winner;}
+ void movePlayer();
+ void moveComputer();
+ void eraseField();
+ int testField(int);
+};
+
+#endif \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_3/Int40.h b/Bachelor/Prog1/Prakt6/prg1p6_3/Int40.h
new file mode 100644
index 0000000..c4949f3
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_3/Int40.h
@@ -0,0 +1,55 @@
+// Programmieren 1, Praktikum 6, Aufgabe 3
+// Author: Sven Eisenhauer
+// Date: 17.01.2005
+// File: Int40.h
+// Description: class Integer40
+
+#ifndef INT40_1
+#define INT40_1
+
+#include<iostream>
+using std::ostream;
+using std::istream;
+
+
+const static int ARRAYSIZE=40;
+
+class Integer40
+{
+public:
+ Integer40();
+ Integer40(const Integer40&);
+ ~Integer40();
+ const Integer40& read();
+ friend istream& operator>> (istream&, Integer40 &);
+ const Integer40& write();
+ friend ostream& operator<< (ostream&, const Integer40&);
+ friend Integer40& operator+ (const Integer40&, const Integer40&);
+ friend Integer40& operator- (const Integer40&, const Integer40&);
+ const Integer40& add(const Integer40&);
+ const Integer40& operator+=(const Integer40&);
+ const Integer40& substract(const Integer40&);
+ const Integer40& operator-=(const Integer40&);
+ const Integer40& operator=(const Integer40&);
+ bool isEqual(const Integer40&) const;
+ bool operator==(const Integer40&) const;
+ bool isNotEqual(const Integer40&) const;
+ bool operator!=(const Integer40&) const;
+ bool isGreaterThan(const Integer40&) const;
+ bool operator>(const Integer40&) const;
+ bool isSmallerThan(const Integer40&) const;
+ bool operator<(const Integer40&) const;
+ bool isGreaterOrEqual(const Integer40&) const;
+ bool operator>=(const Integer40&) const;
+ bool isSmallerOrEqual(const Integer40&) const;
+ bool operator<=(const Integer40&) const;
+ bool isZero();
+ //const Integer40& operator-(const Integer40&);
+ //const Integer40& operator+(const Integer40&);
+
+private:
+ int *int40;
+ //static int nrInt40;
+};
+
+#endif \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_3/int40.cpp b/Bachelor/Prog1/Prakt6/prg1p6_3/int40.cpp
new file mode 100644
index 0000000..16e3f67
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_3/int40.cpp
@@ -0,0 +1,344 @@
+// Programmieren 1, Praktikum 6, Aufgabe 3
+// Author: Sven Eisenhauer
+// Date: 17.01.2005
+// File: int40.cpp
+// Description: Implementation of class Integer40
+
+#include "int40.h"
+#include <cstdlib>
+#include <ctime>
+#include <iostream>
+#include <new>
+
+using std::cout;
+using std::endl;
+using std::cin;
+using std::ostream;
+using std::istream;
+
+
+
+ostream& operator<<(ostream &out, Integer40 &right)
+{
+ right.write();
+
+ return out;
+}
+
+istream& operator>> (istream &in, Integer40 &right)
+{
+ right.read();
+
+ return in;
+}
+
+Integer40& operator+ (const Integer40& left, const Integer40& right)
+{
+ static Integer40 temp;
+
+ int sum=0;
+ int carry=0;
+
+ for (int i=ARRAYSIZE-1;i>=0;i--)
+ {
+ sum=(left.int40[i]+right.int40[i]+carry);
+ if (sum >= 10)
+ {
+ temp.int40[i]=sum%10;
+ carry=1;
+ }
+ else
+ {
+ temp.int40[i]=sum;
+ carry=0;
+ }
+ }
+
+ return temp;
+
+}
+Integer40& operator- (const Integer40& left, const Integer40& right)
+{
+ static Integer40 temp;
+
+ int diff=0;
+ int carry=0;
+
+ for (int i=ARRAYSIZE-1;i>=0;i--)
+ {
+ if (right.int40[i] > left.int40[i])
+ {
+ temp.int40[i]=(left.int40[i]+10)-right.int40[i]-carry;
+ carry=1;
+ }
+ else
+ {
+ temp.int40[i]=left.int40[i]-right.int40[i]-carry;
+ carry=0;
+ }
+
+ }
+
+ return temp;
+}
+
+Integer40::Integer40()
+{
+ int40=new int[ARRAYSIZE];
+ for (int n=0;n<ARRAYSIZE;n++)
+ int40[n]=0;
+// ++nrInt40;
+}
+
+Integer40::Integer40(const Integer40 &toCopy)
+{
+ int40=new int[ARRAYSIZE];
+ for (int n=0;n<ARRAYSIZE;n++)
+ int40[n]=toCopy.int40[n];
+}
+
+Integer40::~Integer40()
+{
+ delete[] int40;
+ //--nrInt40;
+}
+
+const Integer40& Integer40::read()
+{
+ char input[ARRAYSIZE];
+ int i=0;
+ int n=0;
+ int temp[ARRAYSIZE];
+ cout << endl << "Please enter Integer40: ";
+ cin.get(input,ARRAYSIZE);
+ cin.sync();
+ for (n=ARRAYSIZE-strlen(input);n>=0;n--)
+ {
+ temp[n]=0;
+ }
+ i=strlen(input)-1;
+ for (n=ARRAYSIZE-1;n>=ARRAYSIZE-strlen(input);n--)
+ {
+ int40[n]=input[i]-48;
+ i--;
+ }
+ return *this;
+}
+
+const Integer40& Integer40::write()
+{
+ cout << endl;
+ for (int n=0;n<ARRAYSIZE;n++)
+ cout << int40[n];
+ cout << endl;
+
+ return *this;
+}
+
+const Integer40& Integer40::add(const Integer40 &toAdd)
+{
+ int sum=0;
+ int carry=0;
+
+ for (int i=ARRAYSIZE-1;i>=0;i--)
+ {
+ sum=(int40[i]+toAdd.int40[i]+carry);
+ int40[i]=sum%10;
+ if (sum >= 10)
+ carry=1;
+ else
+ carry=0;
+ }
+ return *this;
+}
+
+/*const Integer40& Integer40::operator+(const Integer40 &toAdd)
+{
+ add(toAdd);
+
+ return *this;
+}
+*/
+const Integer40& Integer40::operator+=(const Integer40 &toAdd)
+{
+ add(toAdd);
+
+ return *this;
+}
+
+const Integer40& Integer40::substract(const Integer40 &toSub)
+{
+ int temp=0;
+
+ for (int i=ARRAYSIZE-1;i>=0;i--)
+ {
+ if (toSub.int40[i] > int40[i])
+ {
+ int40[i]=((int40[i])+10)-toSub.int40[i];
+ (int40[i-1])--;
+ }
+ else
+ int40[i]=((int40[i]))-toSub.int40[i];
+
+ }
+ return *this;
+}
+
+/*const Integer40& Integer40::operator-(const Integer40 &toSub)
+{
+ substract(toSub);
+
+ return *this;
+}*/
+
+const Integer40& Integer40::operator-=(const Integer40 &toSub)
+{
+ substract(toSub);
+
+ return *this;
+}
+
+const Integer40& Integer40::operator =(const Integer40 &right)
+{
+ if(&right!=this)
+ {
+ for (int n=0;n<ARRAYSIZE;n++)
+ int40[n]=right.int40[n];
+ }
+
+ return *this;
+}
+
+
+bool Integer40::isGreaterOrEqual(const Integer40 &toCompare) const
+{
+ int i=0;
+ bool retval=true;
+
+ while ((i<ARRAYSIZE)&&(int40[i]==toCompare.int40[i]))
+ {
+ i++;
+ }
+ if (int40[i] < toCompare.int40[i])
+ {
+ retval=false;
+ }
+ return retval;
+}
+
+bool Integer40::operator>=(const Integer40 &toCompare) const
+{
+ return isGreaterOrEqual(toCompare);
+}
+
+bool Integer40::isSmallerOrEqual(const Integer40 &toCompare) const
+{
+ int i=0;
+ bool retval=true;
+
+ while ((i<ARRAYSIZE)&&(int40[i]==toCompare.int40[i]))
+ {
+ i++;
+ }
+ if (int40[i] > toCompare.int40[i])
+ {
+ retval=false;
+ }
+ return retval;
+}
+
+bool Integer40::operator<=(const Integer40 &toCompare) const
+{
+ return isSmallerOrEqual(toCompare);
+}
+
+
+bool Integer40::isGreaterThan(const Integer40 &toCompare) const
+{
+ int i=0;
+ bool retval=true;
+
+ while ((i<ARRAYSIZE)&&(int40[i]==toCompare.int40[i]))
+ {
+ i++;
+ }
+ if (int40[i] <= toCompare.int40[i])
+ {
+ retval=false;
+ }
+ return retval;
+}
+bool Integer40::operator>(const Integer40 &toCompare) const
+{
+ return isGreaterThan(toCompare);
+}
+
+bool Integer40::isSmallerThan(const Integer40 &toCompare) const
+{
+ int i=0;
+ bool retval=true;
+
+ while ((i<ARRAYSIZE)&&(int40[i]==toCompare.int40[i]))
+ {
+ i++;
+ }
+ if (int40[i] >= toCompare.int40[i])
+ {
+ retval=false;
+ }
+ return retval;
+}
+
+bool Integer40::operator<(const Integer40 &toCompare) const
+{
+ return isSmallerThan(toCompare);;
+}
+
+bool Integer40::isEqual(const Integer40 &toCompare) const
+{
+ int i=0;
+ bool retval=true;
+
+ while ((i<ARRAYSIZE)&&(int40[i]==toCompare.int40[i]))
+ {
+ i++;
+ }
+ if (int40[i] != toCompare.int40[i])
+ {
+ retval=false;
+ }
+ return retval;
+}
+
+bool Integer40::operator ==(const Integer40 &toCompare) const
+{
+ return isEqual(toCompare);
+}
+
+bool Integer40::isNotEqual(const Integer40 &toCompare) const
+{
+ return !(*this==toCompare);
+}
+
+bool Integer40::operator !=(const Integer40 &toCompare) const
+{
+ return !(*this==toCompare);
+}
+
+bool Integer40::isZero()
+{
+ int i=0;
+ bool retval=true;
+
+ while (i<ARRAYSIZE)
+ {
+ if(this->int40[i]!=0)
+ {
+ retval=false;
+ break;
+ }
+ i++;
+ }
+
+ return retval;
+} \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp b/Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp
new file mode 100644
index 0000000..60b73dc
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp
@@ -0,0 +1,74 @@
+// Programmieren 1, Praktikum 6, Aufgabe 3
+// Author: Sven Eisenhauer
+// Date: 17.01.2005
+// File: main.cpp
+// Description: Application to test class Integer40
+
+#include "Int40.h"
+#include <new>
+#include <iostream>
+using std::cin;
+using std::cout;
+using std::endl;
+
+
+
+ostream& operator<<(ostream &out, Integer40 &right);
+istream& operator>> (istream &in, Integer40 &right);
+Integer40& operator+ (const Integer40&, const Integer40&);
+Integer40& operator- (const Integer40&, const Integer40&);
+
+int main()
+{
+ Integer40 bigint1;
+ Integer40 bigint2;
+
+ //bigint1.read();
+ cin >> bigint1 >> bigint2;
+ //bigint1.write();
+ //cout << bigint1 ;
+
+ //bigint2.read();
+ //cin >> bigint2;
+ //bigint2.write();
+ cout << bigint1 <<bigint2;
+
+ //bigint1->add(bigint2);
+
+ /*bigint1+=bigint2;
+ cout << bigint1;
+ bigint1-=bigint2;
+ cout << bigint1;
+ */
+
+ cout << bigint1 - bigint2;
+ cout << bigint1 + bigint2;
+
+ if(bigint1 >= bigint2)
+ cout << endl << "BigInt1 is greater or equal BigInt2" << endl;
+ if(bigint1 <= bigint2)
+ cout << endl << "BigInt1 is smaller or equal BigInt2" << endl;
+ if(bigint1 > bigint2)
+ cout << endl << "BigInt1 is greater than BigInt2" << endl;
+ if(bigint1 < bigint2)
+ cout << endl << "BigInt1 is smaller than BigInt2" << endl;
+ if(bigint1 == bigint2)
+ cout << endl << "BigInt1 is equal BigInt2" << endl;
+ if(bigint1.isZero())
+ cout << endl << "BigInt1 is zero" << endl;
+
+ if(bigint2 >= bigint1)
+ cout << endl << "BigInt2 is greater or equal BigInt1" << endl;
+ if(bigint2 <= bigint1)
+ cout << endl << "BigInt2 is smaller or equal BigInt1" << endl;
+ if(bigint2 > bigint1)
+ cout << endl << "BigInt2 is greater than BigInt1" << endl;
+ if(bigint2 < bigint1)
+ cout << endl << "BigInt2 is smaller than BigInt1" << endl;
+ if(bigint2 == bigint1)
+ cout << endl << "BigInt2 is equal BigInt1" << endl;
+ if(bigint2.isZero())
+ cout << endl << "BigInt2 is zero" << endl;
+
+ return 0;
+} \ No newline at end of file
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_3/prg1p6_3.dsp b/Bachelor/Prog1/Prakt6/prg1p6_3/prg1p6_3.dsp
new file mode 100644
index 0000000..aec95a9
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_3/prg1p6_3.dsp
@@ -0,0 +1,108 @@
+# Microsoft Developer Studio Project File - Name="prg1p6_3" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=prg1p6_3 - Win32 Debug
+!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
+!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
+!MESSAGE
+!MESSAGE NMAKE /f "prg1p6_3.mak".
+!MESSAGE
+!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
+!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
+!MESSAGE
+!MESSAGE NMAKE /f "prg1p6_3.mak" CFG="prg1p6_3 - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "prg1p6_3 - Win32 Release" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE "prg1p6_3 - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "prg1p6_3 - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x407 /d "NDEBUG"
+# ADD RSC /l 0x407 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "prg1p6_3 - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x407 /d "_DEBUG"
+# ADD RSC /l 0x407 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "prg1p6_3 - Win32 Release"
+# Name "prg1p6_3 - Win32 Debug"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\int40.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\main.cpp
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Int40.h
+# End Source File
+# End Group
+# Begin Group "Ressourcendateien"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_3/prg1p6_3.dsw b/Bachelor/Prog1/Prakt6/prg1p6_3/prg1p6_3.dsw
new file mode 100644
index 0000000..0f372ae
--- /dev/null
+++ b/Bachelor/Prog1/Prakt6/prg1p6_3/prg1p6_3.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN!
+
+###############################################################################
+
+Project: "prg1p6_3"=.\prg1p6_3.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+