From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- Bachelor/Prog1/Prakt2/index.htm | 156 ++++++++++++++++++++++++++++ Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.cpp | 77 ++++++++++++++ Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.dsp | 100 ++++++++++++++++++ Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.dsw | 29 ++++++ Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.cpp | 86 +++++++++++++++ Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.dsp | 100 ++++++++++++++++++ Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.dsw | 29 ++++++ Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.cpp | 31 ++++++ Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.dsp | 100 ++++++++++++++++++ Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.dsw | 29 ++++++ Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.cpp | 51 +++++++++ Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.dsp | 100 ++++++++++++++++++ Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.dsw | 29 ++++++ Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.cpp | 73 +++++++++++++ Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.dsp | 100 ++++++++++++++++++ Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.dsw | 29 ++++++ Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.cpp | 59 +++++++++++ Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.dsp | 100 ++++++++++++++++++ Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.dsw | 29 ++++++ 19 files changed, 1307 insertions(+) create mode 100644 Bachelor/Prog1/Prakt2/index.htm create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.cpp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.dsp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_1/prg1p2_1.dsw create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.cpp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.dsp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_2/prg1p2_2.dsw create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.cpp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.dsp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_3/prg1p2_3.dsw create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.cpp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.dsp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_4/prg1p2_4.dsw create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.cpp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.dsp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_5/prg1p2_5.dsw create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.cpp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.dsp create mode 100644 Bachelor/Prog1/Prakt2/prg1p2_6/prg1p2_6.dsw (limited to 'Bachelor/Prog1/Prakt2') 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 @@ + + + + +Praktikum 2 + + + +  + + + + + + + + + + +
 
FH Darmstadt  +
FB Informatik  +
Prof.Dr. H.P.Weber
+
Programmieren I  +
Praktikum
+
+
2
+
+ +
+ + + + +
Ziel: +Sie sollen einfache und komplexere Kontrollstrukturen üben. +
+
+ + + + + + +
1    Einfaches Histogramm erstellen + +
    +
  • +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:
    +
    *******
  • + +
+ +
+ + + + + + + +
2    Binär-Dezimalwandlung +
    +
  • +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.
  • +
  • +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
  • + +
  • +Realisieren Sie auch die umgekehrte Operation: Das Programm soll eine +eingegebene Dezimalzahl in ihre binäre Darstellung umwandeln. 
  • + +
+
+ + + + + + + +
3    Ganzzahlige rechtwinklige Dreiecke +
    +
  • +Es gibt rechtwinklige Dreiecke (d.h. Dreiecke für die der Satz des Pythagoras +gilt), deren Seitenlängen alle ganze Zahlen sind.  
  • +
  • +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.
  • + +
  • +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.
  • + +
+
+ + + + + + +
4    Primzahlen
    +
  • +Schreiben Sie ein Programm, das eine positive ganze Zahl von der Tastatur +einliest und alle Primzahlen, die kleiner als diese Zahl sind, ausgibt. + +
+
+ + + + + + +
5    Primzahlzwillinge (fakultativ) + +
    +
  • +Schreiben Sie ein Programm, das zwei positive ganze Zahlen von der Tastatur +einliest und alle Primzahlzwillinge, die zwischen diesen beiden Zahlen liegen, ausgibt. +
  • +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. + +
+
+ + + + + + +
6    Binär-, +Oktal- und Hexadezimaldarstellung (fakultativ) + +
    +
  • +Schreiben Sie ein Programm, das eine Tabelle der binären, oktalen und +hexadezimalen Darstellung der ganzen Dezimalzahlen von 1 bis 256 ausgibt. + +
+
+ + \ 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 +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 +#include +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 (pow(2,iCounter))); + iBin=iBin%static_cast (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"<=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 (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 +#include + +using std::cin; +using std::cout; +using std::endl; +using std::setw; + +int main() +{ + int a,b,c=1; + + cout < +# 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 +#include + +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 +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 +#include +#include + +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 (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 (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> +{{{ +}}} + +############################################################################### + -- cgit v1.2.3