diff options
Diffstat (limited to 'Bachelor/Prog1/Prakt2')
19 files changed, 1307 insertions, 0 deletions
diff --git a/Bachelor/Prog1/Prakt2/index.htm b/Bachelor/Prog1/Prakt2/index.htm new file mode 100644 index 0000000..872f2ac --- /dev/null +++ b/Bachelor/Prog1/Prakt2/index.htm @@ -0,0 +1,156 @@ +<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<title>Praktikum 2</title></head>
+
+<body>
+
+
+<table border="1" cellspacing="0" width="100%">
+<caption> </caption>
+
+<tbody><tr>
+<td bgcolor="#efefde" width="25%">FH Darmstadt
+<br>FB Informatik
+<br>Prof.Dr. H.P.Weber</td>
+
+<td>
+<center><font size="+3">Programmieren I </font>
+<br><font size="+3">Praktikum</font></center>
+</td>
+
+<td bgcolor="#efefde" width="25%">
+<center><font size="+4">2</font></center>
+</td>
+</tr>
+</tbody></table>
+
+<br>
+<table border="1" width="100%">
+<tbody><tr valign="top">
+<td>Ziel:</td><td>
+Sie sollen einfache und komplexere Kontrollstrukturen üben.
+</td>
+</tr>
+</tbody></table>
+<br>
+
+<table border="1" width="100%">
+<tbody><tr>
+<td><b><font size="+1">1 Einfaches Histogramm erstellen</font></b>
+
+<ul>
+<li>
+Schreiben Sie ein Programm, das fünf Zahlen (jede zwischen 1 und 80) von der
+ Konsole einliest. Für jede eingegebene Zahl soll Ihr Programm eine Zeile mit
+ entsprechend vielen aneinander hängenden Sternchen (*) ausgeben. Zum Beispiel
+ soll für eine eingegebene Zahl 7 folgende Zeile ausgegeben werden:<br>
+ <br>*******</li>
+
+</ul>
+
+</td>
+
+</tr>
+</tbody></table>
+
+
+<table border="1" width="100%">
+<tbody><tr>
+<td><b><font size="+1">2 Binär-Dezimalwandlung</font></b>
+<ul>
+<li>
+Schreiben Sie ein Programm, das eine binäre Zahl (also eine
+ganze Zahl, die als Ziffern nur 0 oder 1 enthält) einliest und ihr dezimales
+Äquivalent ausgibt. Die eingegebene binäre Zahl soll maximal 10-stellig
+sein.</li>
+<li>
+Hinweis: Nutzen Sie modulo- und Divisionsoperator, um die binären Ziffern eine
+nach der anderen von rechts nach links abzuspalten. Bauen Sie aus den binären
+Ziffern zusammen mit ihrer jeweiligen Wertigkeit die dezimale Zahl auf</li>
+
+<li>
+Realisieren Sie auch die umgekehrte Operation: Das Programm soll eine
+eingegebene Dezimalzahl in ihre binäre Darstellung umwandeln. </li>
+
+</ul>
+</td>
+
+</tr>
+</tbody></table>
+
+
+<table border="1" width="100%">
+<tbody><tr>
+<td><b><font size="+1">3 Ganzzahlige rechtwinklige Dreiecke</font></b>
+<ul>
+<li>
+Es gibt rechtwinklige Dreiecke (d.h. Dreiecke für die der Satz des Pythagoras
+gilt), deren Seitenlängen alle ganze Zahlen sind. </li>
+<li>
+Schreiben Sie ein Programm, das alle diese Dreiecke in Form der Längen ihrer
+drei Seiten findet. Hierbei sollen nur Seitenlängen, die nicht größer als 500
+sind, berücksichtigt werden. Geben Sie zusätzlich die Anzahl der gefundenen
+Dreiecke aus.</li>
+
+<li>
+Hinweis: Nutzen Sie eine dreifach geschachtelte for-Schleife, die alle
+Möglichkeiten ausprobiert. Diese Vorgehensweise ist ein Beispiel für eine
+sogenannte "Brute Force"-Methode.</li>
+
+</ul>
+</td>
+
+</tr>
+</tbody></table>
+
+<table border="1" width="100%">
+<tbody><tr>
+<td><b><font size="+1">4 Primzahlen</font></b><ul>
+<li>
+Schreiben Sie ein Programm, das eine positive ganze Zahl von der Tastatur
+einliest und alle Primzahlen, die kleiner als diese Zahl sind, ausgibt.
+
+</li></ul>
+</td>
+
+</tr>
+</tbody></table>
+
+<table border="1" width="100%">
+<tbody><tr>
+<td><b><font size="+1">5 Primzahlzwillinge (fakultativ)</font></b>
+
+<ul>
+<li>
+Schreiben Sie ein Programm, das zwei positive ganze Zahlen von der Tastatur
+einliest und alle Primzahlzwillinge, die zwischen diesen beiden Zahlen liegen, ausgibt.
+</li><li>
+Als Primzahlzwillinge bezeichnet man zwei Primzahlen, die 'direkt' benachbart
+sind, also nur durch die zwischen ihnen liegende gerade Zahl getrennt sind.
+Beispiele sind 3 und 5 oder 17 und 19.
+
+</li></ul>
+</td>
+
+</tr>
+</tbody></table>
+
+<table border="1" width="100%">
+<tbody><tr>
+<td><font size="+1"><b>6</b></font><b><font size="+1"> Binär-,
+Oktal- und Hexadezimaldarstellung (fakultativ)</font></b>
+
+<ul>
+<li>
+Schreiben Sie ein Programm, das eine Tabelle der binären, oktalen und
+hexadezimalen Darstellung der ganzen Dezimalzahlen von 1 bis 256 ausgibt.
+
+</li></ul>
+</td>
+
+</tr>
+</tbody></table>
+
+</body></html>
\ No newline at end of file diff --git a/Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.cpp b/Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.cpp new file mode 100644 index 0000000..98036aa --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.cpp @@ -0,0 +1,77 @@ +// Programmieren 1, Praktikum 2, Aufgabe 1
+// Sven Eisenhauer
+// 29.10.2004
+//
+// file: prg1p2_1.cpp
+//
+// purpose: program to read 5 integer numbers (between 1 and 80) from keyboard and for each
+// number to draw the amount of "*"-characters in one line on the screen.
+//
+#include <iostream>
+using std::cin;
+using std::cout;
+using std::endl;
+
+int main()
+{
+ int iNumber1,iNumber2,iNumber3,iNumber4,iNumber5;
+
+ cout << "Please enter number 1: ";
+ cin >> iNumber1;
+ cout << "Please enter number 2: ";
+ cin >> iNumber2;
+ cout << "Please enter number 3: ";
+ cin >> iNumber3;
+ cout << "Please enter number 4: ";
+ cin >> iNumber4;
+ cout << "Please enter number 5: ";
+ cin >> iNumber5;
+
+ for (int iCounter=1;iCounter<=iNumber1;iCounter++)
+ cout << "*";
+ cout << endl;
+ for (iCounter=1;iCounter<=iNumber2;iCounter++)
+ cout << "*";
+ cout << endl;
+ for (iCounter=1;iCounter<=iNumber3;iCounter++)
+ cout << "*";
+ cout << endl;
+ for (iCounter=1;iCounter<=iNumber4;iCounter++)
+ cout << "*";
+ cout << endl;
+ for (iCounter=1;iCounter<=iNumber5;iCounter++)
+ cout << "*";
+ cout << endl;
+/*
+
+ int iInput[5];
+
+ //input repitition
+ for (int iCounter=1;iCounter<=5;iCounter++)
+ {
+ cout << "Please enter " << iCounter << ". number (between 1 and 80): ";
+ cin >> iInput[iCounter-1];
+
+ // check input
+ while (iInput[iCounter-1]<1 || iInput[iCounter-1]>80)
+ {
+ cout<<"\nNumber not between 1 and 80, please enter a new one: ";
+ cin >> iInput[iCounter-1];
+ }// end while
+
+
+ }// end for input repitition
+
+ //output repition
+ for (iCounter=1;iCounter<=5;iCounter++)
+ {
+ // draw star characters
+ for (int iStarCounter=1;iStarCounter<=iInput[iCounter-1];iStarCounter++)
+ cout <<"*";
+
+ // new line for next number
+ cout << endl;
+ }// end output
+*/
+ return 0; // everything ok
+}// end main
diff --git a/Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.dsp b/Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.dsp new file mode 100644 index 0000000..bf231f2 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.dsp @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="prg1p2_1" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=prg1p2_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 "prg1p2_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 "prg1p2_1.mak" CFG="prg1p2_1 - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "prg1p2_1 - Win32 Release" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE "prg1p2_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)" == "prg1p2_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)" == "prg1p2_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 "prg1p2_1 - Win32 Release"
+# Name "prg1p2_1 - Win32 Debug"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\prg1p2_1.cpp
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# 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/Prakt2/prg1p2_1/prg1p2_1.dsw b/Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.dsw new file mode 100644 index 0000000..9a01f06 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_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: "prg1p2_1"=.\prg1p2_1.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.cpp b/Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.cpp new file mode 100644 index 0000000..1ac93e1 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.cpp @@ -0,0 +1,86 @@ +// Programmieren 1, Praktikum 2, Aufgabe 2
+// Sven Eisenhauer
+// 29.10.2004
+//
+// file: prg1p2_2.cpp
+//
+// purpose: convert bin to dec numbers or dec numbers to bin
+// 10 digits mean 2exp9 to 2exp0
+//
+#include <iostream>
+#include <cmath>
+using std::cin;
+using std::cout;
+using std::endl;
+
+int main()
+{
+ const iBit=10; //define how large the binary output should be.
+
+ int iMode;
+ int iBin=0;
+ int iActualFactor=0;
+ int iDec=0;
+ int iCounter=0;
+ int iCounter2=0;
+ //int iBinOut[iBit];
+ int iBinOut=0;
+
+
+ do
+ {
+ system("cls");
+ cout << "Please select Converter:\n1) Bin -> Dec\n2) Dec -> Bin\n\n0) End\n\n"
+ "Your selection: ";
+ cin >> iMode;
+ switch (iMode) {
+ case 1:
+ cout << "\nPlease enter a binary number (max 10 characters): ";
+ cin >> iBin;
+ for (iCounter = 9;iCounter>=0;iCounter--)
+ {
+ iActualFactor=iBin/pow(10,iCounter);
+ iDec+=(iActualFactor * static_cast <int> (pow(2,iCounter)));
+ iBin=iBin%static_cast <int>(pow(10,iCounter));
+ }
+ cout << "\nDecimal: " << iDec;
+ cout << endl;
+ system ("pause");
+ break; // end bin2dec
+ case 2://dec2bin
+ cout << "\nPlease enter a decimal number: ";
+ cin >> iDec;
+ cout << "\n"<<iBit<<"-bit Integer is: ";
+ /* // fill the array
+ for (iCounter=iBit-1;iCounter>=0;iCounter--)
+ {
+ iBinOut[iCounter]=iDec%2;
+ iDec=iDec/2;
+ }
+ // print array in reverse order
+ for (iCounter=0;iCounter<=iBit-1;iCounter++)
+ {
+ cout << iBinOut[iCounter];
+ if (0==((iCounter+1)%4)) // space separator after 4 bit
+ cout <<" ";
+ }
+ */
+ iBinOut=0;
+ for (iCounter2=iBit;iCounter2>=0;iCounter2--)
+ {
+ iBin=iDec%2;
+ iDec=iDec/2;
+ iBinOut += iBin * static_cast <int> (pow(10,iBit-iCounter2));
+ }
+ cout << iBinOut << endl;
+ system ("pause");
+ break; // end dec2bin
+ case 0: // end selected... we are leaving...
+ break;
+ default: // wrong selection
+ cout << "\n !! No functon selected !!";
+ } // end switch
+ } // end while
+ while (iMode != 0);
+ return 0; // so far, we are ok
+}// end main
\ No newline at end of file diff --git a/Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.dsp b/Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.dsp new file mode 100644 index 0000000..63ba0bc --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.dsp @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="prg1p2_2" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=prg1p2_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 "prg1p2_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 "prg1p2_2.mak" CFG="prg1p2_2 - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "prg1p2_2 - Win32 Release" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE "prg1p2_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)" == "prg1p2_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)" == "prg1p2_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 "prg1p2_2 - Win32 Release"
+# Name "prg1p2_2 - Win32 Debug"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\prg1p2_2.cpp
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# 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/Prakt2/prg1p2_2/prg1p2_2.dsw b/Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.dsw new file mode 100644 index 0000000..8fa2314 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_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: "prg1p2_2"=.\prg1p2_2.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.cpp b/Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.cpp new file mode 100644 index 0000000..259648e --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.cpp @@ -0,0 +1,31 @@ +// Programmieren 1, Praktikum 2, Aufgabe 3
+// Sven Eisenhauer
+// 29.10.2004
+//
+// file: prg1p2_3.cpp
+//
+// purpose: find triangles, which fit a*a + b*b = c*c, for integer a,b,c < 500
+//
+//
+#include <iostream>
+#include <iomanip>
+
+using std::cin;
+using std::cout;
+using std::endl;
+using std::setw;
+
+int main()
+{
+ int a,b,c=1;
+
+ cout <<setw(4)<<"A"<<setw(4)<<"B"<<setw(4)<<"C";
+
+ for (a=1;a<500;a++)
+ for (b=1;b<500;b++)
+ for (c=1;c<500;c++)
+ if ((a*a)+(b*b)==(c*c))
+ cout <<setw(4)<<a<<setw(4)<<b<<setw(4)<<c<<endl;
+
+ return 0; // so far, we are ok
+}// end main
\ No newline at end of file diff --git a/Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.dsp b/Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.dsp new file mode 100644 index 0000000..5fc793c --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.dsp @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="prg1p2_3" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=prg1p2_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 "prg1p2_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 "prg1p2_3.mak" CFG="prg1p2_3 - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "prg1p2_3 - Win32 Release" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE "prg1p2_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)" == "prg1p2_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)" == "prg1p2_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 "prg1p2_3 - Win32 Release"
+# Name "prg1p2_3 - Win32 Debug"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\prg1p2_3.cpp
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# 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/Prakt2/prg1p2_3/prg1p2_3.dsw b/Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.dsw new file mode 100644 index 0000000..6045ba4 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_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: "prg1p2_3"=.\prg1p2_3.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.cpp b/Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.cpp new file mode 100644 index 0000000..b649a6a --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.cpp @@ -0,0 +1,51 @@ +// Programmieren 1, Praktikum 2, Aufgabe 4
+// Sven Eisenhauer
+// 05.11.2004
+//
+// file: prg1p2_4.cpp
+//
+// purpose: Program to find all prime numbers, which are smaller than the entered positive number
+//
+
+#include <iostream>
+#include <iomanip>
+
+using std::cin;
+using std::cout;
+using std::endl;
+
+int main()
+{
+ int iNumber=0;
+ int iIsPrime=0;
+
+ system ("cls");
+ cout << "Please enter a positive number: ";
+ cin >> iNumber;
+ if (0 >= iNumber) // handle wrong input in some way
+ {
+ cout << "Not a positive number!!!";
+ system ("pause");
+ }
+ else // end error handler
+ { // let's begin
+ for (int iOuterCounter=iNumber;iOuterCounter>1;iOuterCounter--)
+ { // decrement the number and check, if it is a prime (modulo any number is 0)
+ iIsPrime=0; // we asume actual number is a prime
+ for (int iInnerCounter=iOuterCounter-1;iInnerCounter>1;iInnerCounter--)
+ {
+ if ( 0 == iOuterCounter%iInnerCounter)
+ {
+ iIsPrime=1; // actual number is NOT a prime
+ }
+ }// end inner for routine
+ if (0 == iIsPrime)
+ cout << endl << iOuterCounter;
+
+ } // end outer for routine
+ cout << endl;
+ system ("pause"); // wait a moment for user to read
+
+ } // end else
+ return 0;
+}// end main
\ No newline at end of file diff --git a/Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.dsp b/Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.dsp new file mode 100644 index 0000000..b3ac1d9 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.dsp @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="prg1p2_4" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=prg1p2_4 - 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 "prg1p2_4.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 "prg1p2_4.mak" CFG="prg1p2_4 - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "prg1p2_4 - Win32 Release" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE "prg1p2_4 - 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)" == "prg1p2_4 - 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)" == "prg1p2_4 - 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 "prg1p2_4 - Win32 Release"
+# Name "prg1p2_4 - Win32 Debug"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\prg1p2_4.cpp
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# 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/Prakt2/prg1p2_4/prg1p2_4.dsw b/Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.dsw new file mode 100644 index 0000000..1d4963a --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.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: "prg1p2_4"=.\prg1p2_4.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.cpp b/Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.cpp new file mode 100644 index 0000000..0691d20 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.cpp @@ -0,0 +1,73 @@ +// Programmieren 1, Praktikum 2, Aufgabe 5
+// Sven Eisenhauer
+// 06.11.2004
+//
+// file: prg1p2_5.cpp
+//
+// purpose: program to reads 2 integers from keyboard and finds all prime number twins
+// between them, like 3 and 5 or 17 and 19
+//
+
+#include <iostream>
+using std::cin;
+using std::cout;
+using std::endl;
+
+int main()
+{
+ int iNumberA, iNumberB;
+ int iMin, iMax;
+ int iIsPrime1=0;
+ int iIsPrime2=0;
+ int iPrime1=0;
+ int iPrime2=0;
+ int iToTest=0;
+
+ cout << "Please enter 1st number: ";
+ cin >> iNumberA;
+ cout << "Please enter 2nd number: ";
+ cin >> iNumberB;
+ cout << endl;
+
+ // first find out, which is the bigger value.
+ iMax=iNumberA;
+ iMin=iNumberB;
+
+ if (iNumberB > iNumberA)
+ {
+ iMax=iNumberB;
+ iMin=iNumberA;
+ }
+ // First loop: Get all numbers between the 2 entered
+ for (int iOuterCounter=iMax-1;iOuterCounter>iMin;iOuterCounter--)
+ {
+ iIsPrime1=0;
+ for (int iInnerCounter=iOuterCounter-1;iInnerCounter>1;iInnerCounter--)
+ {
+ if ( 0 == iOuterCounter%iInnerCounter)
+ iIsPrime1=1; // actual number is NOT a prime
+ }// end inner for routine
+ if (0 == iIsPrime1)
+ {
+ iPrime1=iOuterCounter;
+ // now test, if iPrime1 - 2 is a prime
+ iIsPrime2 = 0;
+ iToTest = iOuterCounter - 2;
+ for (int iInnerCounter2=iToTest-1;iInnerCounter2>1;iInnerCounter2--)
+ {
+ if (0 == iToTest%iInnerCounter2)
+ iIsPrime2=1;
+ }
+ if (0 == iIsPrime2)
+ iPrime2=iToTest;
+
+ if ((0 == iIsPrime1) && (0 == iIsPrime2) && (iPrime2 > iMin))
+ cout << iPrime1 << "\t" << iPrime2 << endl;
+ }
+ // if (iIsPrime1 && iIsPrime2)
+ // cout << iPrime1 << "\t" << iPrime2 << endl;
+ }
+// system ("pause");
+
+ return 0;
+}// end main
diff --git a/Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.dsp b/Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.dsp new file mode 100644 index 0000000..7ad88a6 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.dsp @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="prg1p2_5" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=prg1p2_5 - 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 "prg1p2_5.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 "prg1p2_5.mak" CFG="prg1p2_5 - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "prg1p2_5 - Win32 Release" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE "prg1p2_5 - 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)" == "prg1p2_5 - 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)" == "prg1p2_5 - 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 "prg1p2_5 - Win32 Release"
+# Name "prg1p2_5 - Win32 Debug"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\prg1p2_5.cpp
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# 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/Prakt2/prg1p2_5/prg1p2_5.dsw b/Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.dsw new file mode 100644 index 0000000..d819093 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.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: "prg1p2_5"=.\prg1p2_5.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.cpp b/Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.cpp new file mode 100644 index 0000000..70abc04 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.cpp @@ -0,0 +1,59 @@ +// Programmieren 1, Praktikum 2, Aufgabe 6
+// Sven Eisenhauer
+// 06.11.2004
+//
+// file: prg1p2_6.cpp
+//
+// purpose: generate a table of bin, oct and hex presentation of the numbers from 1 to 256
+//
+//
+
+#include <iostream>
+#include <iomanip>
+#include <cmath>
+
+using std::cin;
+using std::cout;
+using std::endl;
+using std::setw;
+using std::hex;
+using std::dec;
+
+const int iBit=8; // 256 is 8 bit
+
+int iDec,iOct,iHex,iBin,iTemp;
+
+int main()
+{
+ cout << setw(5) << "Dec" << setw (11) << "Binary" << setw(7) << "Octal" << setw(5) << "Hex" << endl;
+
+ for (int iCounter=1;iCounter<=256;iCounter++)
+ {
+ iDec=iCounter;
+ iTemp=0;
+ iBin=0;
+ iOct=0;
+ // generate binary
+ for (int iBinC=iBit;iBinC>=0;iBinC--)
+ {
+ iTemp = iDec % 2;
+ iDec = iDec / 2;
+ iBin += iTemp * static_cast <int> (pow(10,iBit-iBinC));
+
+ }
+ // generate octal
+ iDec=iCounter;
+ for ( int iOctC=3;iOctC>=0;iOctC--)
+ {
+ iTemp = iDec % 8;
+ iDec = iDec / 8;
+ iOct += iTemp * static_cast <int> (pow(10,3-iOctC));
+ }
+ cout << setw(5) << dec << iCounter << setw (11) << iBin << setw(7) << iOct << setw(5) << hex << iCounter << endl;
+ if (!(iCounter%23))
+ cout << endl << setw(5) << "Dec" << setw (11) << "Binary" << setw(7) << "Octal" << setw(5) << "Hex" << endl;
+ }
+
+
+ return 0;
+}// end main
diff --git a/Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.dsp b/Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.dsp new file mode 100644 index 0000000..5958ba3 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.dsp @@ -0,0 +1,100 @@ +# Microsoft Developer Studio Project File - Name="prg1p2_6" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=prg1p2_6 - 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 "prg1p2_6.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 "prg1p2_6.mak" CFG="prg1p2_6 - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "prg1p2_6 - Win32 Release" (basierend auf "Win32 (x86) Console Application")
+!MESSAGE "prg1p2_6 - 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)" == "prg1p2_6 - 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)" == "prg1p2_6 - 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 "prg1p2_6 - Win32 Release"
+# Name "prg1p2_6 - Win32 Debug"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\prg1p2_6.cpp
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# 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/Prakt2/prg1p2_6/prg1p2_6.dsw b/Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.dsw new file mode 100644 index 0000000..6de9111 --- /dev/null +++ b/Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.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: "prg1p2_6"=.\prg1p2_6.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
|
