From 9d8b69009637d4650d3f473e7e489b9f7306e728 Mon Sep 17 00:00:00 2001 From: Sage The DM Date: Mon, 24 Jun 2024 08:22:15 +0200 Subject: [PATCH] fixed the ims-java --- Code/IMS-java | 1 - Code/JavaOldCode/.vscode/settings.json | 8 +++ Code/JavaOldCode/README.md | 18 ++++++ Code/JavaOldCode/bin/Archiv/Gaptext.class | Bin 0 -> 2341 bytes Code/JavaOldCode/bin/Archiv/Sort.class | Bin 0 -> 1651 bytes Code/JavaOldCode/bin/Archiv/Yoda.class | Bin 0 -> 1509 bytes Code/JavaOldCode/bin/Archiv/exchange.class | Bin 0 -> 622 bytes Code/JavaOldCode/bin/Grundlagen.class | Bin 0 -> 1831 bytes Code/JavaOldCode/bin/Testcode.class | Bin 0 -> 367 bytes Code/JavaOldCode/src/Archiv/Gaptext.java | 46 ++++++++++++++++ Code/JavaOldCode/src/Archiv/Sort.java | 33 +++++++++++ Code/JavaOldCode/src/Archiv/Yoda.java | 32 +++++++++++ Code/JavaOldCode/src/Archiv/exchange.java | 33 +++++++++++ Code/JavaOldCode/src/Grundlagen.java | 61 +++++++++++++++++++++ Code/JavaOldCode/src/Testcode.java | 5 ++ 15 files changed, 236 insertions(+), 1 deletion(-) delete mode 160000 Code/IMS-java create mode 100644 Code/JavaOldCode/.vscode/settings.json create mode 100644 Code/JavaOldCode/README.md create mode 100644 Code/JavaOldCode/bin/Archiv/Gaptext.class create mode 100644 Code/JavaOldCode/bin/Archiv/Sort.class create mode 100644 Code/JavaOldCode/bin/Archiv/Yoda.class create mode 100644 Code/JavaOldCode/bin/Archiv/exchange.class create mode 100644 Code/JavaOldCode/bin/Grundlagen.class create mode 100644 Code/JavaOldCode/bin/Testcode.class create mode 100644 Code/JavaOldCode/src/Archiv/Gaptext.java create mode 100644 Code/JavaOldCode/src/Archiv/Sort.java create mode 100644 Code/JavaOldCode/src/Archiv/Yoda.java create mode 100644 Code/JavaOldCode/src/Archiv/exchange.java create mode 100644 Code/JavaOldCode/src/Grundlagen.java create mode 100644 Code/JavaOldCode/src/Testcode.java diff --git a/Code/IMS-java b/Code/IMS-java deleted file mode 160000 index d3092e6..0000000 --- a/Code/IMS-java +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d3092e64bf931d5b98fa000fca03fa1069647646 diff --git a/Code/JavaOldCode/.vscode/settings.json b/Code/JavaOldCode/.vscode/settings.json new file mode 100644 index 0000000..3652cd9 --- /dev/null +++ b/Code/JavaOldCode/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ], + "java.format.settings.url": "eclipse-formatter.xml" +} diff --git a/Code/JavaOldCode/README.md b/Code/JavaOldCode/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/JavaOldCode/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/Code/JavaOldCode/bin/Archiv/Gaptext.class b/Code/JavaOldCode/bin/Archiv/Gaptext.class new file mode 100644 index 0000000000000000000000000000000000000000..8d1715a5006d73d871c9e446632cde3e6ab132ca GIT binary patch literal 2341 zcma)7O;;0V6nEnaP<#Puu5BA`+R?Q^LF-_qp%A_kHfYGr#=3^)rCW zSTWEg(0?^3SDlUGEm@D$lgL0qVDDqOA&ai`R*UzRAFFaCki6u0PV|mIcQ$ulATi@t zR0`ebO```%fq|0ask`g7Wfd&SWmgGgN`6_o_hsPdeOs7_s!m7;rB1KYv{;jlCvYJ9 zsPxMFLKHaO>U8eDiG2b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/JavaOldCode/bin/Archiv/Sort.class new file mode 100644 index 0000000000000000000000000000000000000000..29139305f3005b5305f6742b349cfee0ea475f73 GIT binary patch literal 1651 zcmaJ?TW=dh7(J7$y^iBHiIZ(EB*lT0CMne1T4>w^(zGEiPHzrD2nlt(8O7VIcg^lN zB;px~7aoy#;sI5l^431IQjquo`~rRkzW_M1&c#)t*z(Mr`EGN*@0;;o|L*+>U>={@ z=o08%jNH1nU95(YwqXhMKa$(B=*wWUc(?XQxmqB7-3vUuAkaNMvo2sQg&Qi1ZuI1k zLRz4&;sxqXt5H+YnymRsAYTbx>95PkGkAZ~(seHuI8*5eS)#j!^a6o%(_dDOLRWR< z1)C)kE_-XoRZZ=ML2M&0FnFYOD6uhgaPpS+{Ne){Y=n(02GL`N;T%RVDqsg{N0$Rq zvZl*3OK6B$tA9pdco`=9> z9$lEs;4Oi%wYnVD;0dK<8%0S~Om`$D?5GsmAk**ymTi+>MA<;Oa{wi`YW%ruo~oAa z)~akKJ!Rtx`=c7RB3CVYrtx}AA73`^S=1Y0sAC<;=Bm>5a3jv*CYEj75|}#bAuret zw^Xs+aP1NIT|rH(aSNn zzs}(dQ4h|dk52lzwkR1eZp1E~8+XtCz~C1zctHpL{%3yRV*kRWiSZ5V;d7iDe|XjE z1gTDteugo}+Cu?&jwu6Ddzd{0={;OZfMYqS$8b2MALA_b@^4cAH_SUJ$1;M{q2O{N zm~zr>LE0E57H=nlUSs?&mxgmU4CmW0FGz;pUUJTnVIL+q&XVH?e6((22>0ROD-6Tu z`=v38?=XfR_-g%(ar{c{Cw!)!l7`9KN;@NXA6F8;zvC+Xu;A4E5Z96%{(?EKx@q|% zN?cit_C2n1m7?yq{8zZfS}f3h7}kII2DXilYzzwX0Y*k_8h=c27Z!1Y^APb0gOro; S(_~!5T}raty@v-_!|4Aq3Wh)c literal 0 HcmV?d00001 diff --git a/Code/JavaOldCode/bin/Archiv/Yoda.class b/Code/JavaOldCode/bin/Archiv/Yoda.class new file mode 100644 index 0000000000000000000000000000000000000000..710eb519679d7e24850c5af9db1acfca73c66c3c GIT binary patch literal 1509 zcmaJ>ZE_n$5Pf6I+O?u!TSop!{4oY6mJ?wa0tT$a#1S!3koky>Qz`yN zWULh2gKNN#q$*T#fSe%5-~<$JB~g*fE>xxI?%AF>wjMT1>g>L9SjLv+77D? z@1*d=)RcpS!1yzDq6)qW>Vn8t zn82ii%o$>Poyh8D8t)=YQl?Fg+1_E#6u#q0%kx?_i!P=G=C@^)jAf{QYU{|#j%mw= zI?=MJYC507EUr4ZA~4y#{wzWobC?%!S}~|kn%Ue%EL|)LEbeF(%D~vXd}=~jmZ~Wm zI@Hn{sl3{nizSjN2l62m&Pyd@k=v@SWn^SMR6#B8;{7;f#rLJJgIbrWB8cCj8YCUm z)*M{>Pm8wo{K6w{nq~^i7>$=)8mqWL#(_Sy<$%g0a^=->hAq#h@d4HZrkmo>Kq$Ujze|Y4~I@q1%^5uF3+E{(NUWisXfyUt9r+a=WH|{+qD>! zn%pzSMmAKfU2Pkt7Nu|(_Z(~sEO)Q%&a@Ytm}6b&%~wx^9aXg^?8NGn1b!QAa6h{T z_<&XTI$Ew6bKGtf&#N@BbLQZFr=>4QAJnS%suc&N??aT7@9%k57srzL!o`lj)qVDW zT1fL$io6t(ytsPNrW69{auDdSn4pUk#z}pK)FsL0kU<`kSjQAUqtkfECy#Ljir)&01^j}= zZlRBQ#o$AHM4TLcz%6{tQuFv8pJ0Q^tz#FT(ig&v4)txMe7pnOaAZUD@G}L4|u+U*?$2o<7%b= literal 0 HcmV?d00001 diff --git a/Code/JavaOldCode/bin/Archiv/exchange.class b/Code/JavaOldCode/bin/Archiv/exchange.class new file mode 100644 index 0000000000000000000000000000000000000000..b6e01da14b22ab3d0320026630d14016f8c89c87 GIT binary patch literal 622 zcmZut-AV#M7(Jt_o12woW~F7npkBBSpa~HKfmC34)77{QI-$FhyE1fzh{)Oxgl)zHUbL5~SeI5GWK_lqv zTY<&apRsjP4yASlR?3&H>G*cwYqwXgbW&JE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GzB*GC&2!7w#e-)`5Lb_P& literal 0 HcmV?d00001 diff --git a/Code/JavaOldCode/src/Archiv/Gaptext.java b/Code/JavaOldCode/src/Archiv/Gaptext.java new file mode 100644 index 0000000..8fccecc --- /dev/null +++ b/Code/JavaOldCode/src/Archiv/Gaptext.java @@ -0,0 +1,46 @@ +package Archiv; + +import javax.swing.JOptionPane; + +public class Gaptext { + public static void main(String[] args) { + // Lückentexte / kombination aus variablen, print und if/else + + // Popups mit User Input + String a = JOptionPane.showInputDialog("Please enter a verb (-ing):"); + String b = JOptionPane.showInputDialog("Please enter a location:"); + String c = JOptionPane.showInputDialog("Please enter a color:"); + String d = JOptionPane.showInputDialog("Please enter something that's that color:"); + String e = JOptionPane.showInputDialog("Please enter a diffrent color:"); + String f = JOptionPane.showInputDialog("Please enter something that's that color:"); + String g = JOptionPane.showInputDialog("Please enter an adjective:"); + String h = JOptionPane.showInputDialog("Please enter an object"); + + // Error message + + if (a == null || a.trim().isEmpty()) { + System.out.println("Missing word(s) or canceled."); + } else if (b == null || b.trim().isEmpty()) { + System.out.println("Missing word(s) or canceled."); + } else if (c == null || c.trim().isEmpty()) { + System.out.println("Missing word(s) or canceled."); + } else if (d == null || d.trim().isEmpty()) { + System.out.println("Missing word(s) or canceled."); + } else if (e == null || e.trim().isEmpty()) { + System.out.println("Missing word(s) or canceled."); + } else if (f == null || f.trim().isEmpty()) { + System.out.println("Missing word(s) or canceled."); + } else if (g == null || g.trim().isEmpty()) { + System.out.println("Missing word(s) or canceled."); + } else if (h == null || h.trim().isEmpty()) { + System.out.println("Missing word(s) or canceled."); + } else { + + // Lückentext mit variablen + + System.out.println("They where " + a + " throw (a) " + b + ". They're eyes where "); + System.out.println(c + " as (the) " + d + " They're hair as " + e + " as (the) " + f + "."); + System.out.println("It was a " + g + " day, after a long journey they finally found their " + h); + } + } +} \ No newline at end of file diff --git a/Code/JavaOldCode/src/Archiv/Sort.java b/Code/JavaOldCode/src/Archiv/Sort.java new file mode 100644 index 0000000..52babb2 --- /dev/null +++ b/Code/JavaOldCode/src/Archiv/Sort.java @@ -0,0 +1,33 @@ +package Archiv; + +import java.util.Random; + +public class Sort { + public static void main(String[] args) throws Exception { + // Creating a Random object + Random random = new Random(); + + // Define the range for variables + int minRange = -10000; + int maxRange = 10000; + + // Generate random values + int a = random.nextInt(maxRange - minRange + 1) + minRange; + int b = random.nextInt(maxRange - minRange + 1) + minRange; + int c = random.nextInt(maxRange - minRange + 1) + minRange; + + System.out.println("a equals:" + a); + System.out.println("b equals:" + b); + System.out.println("c equals:" + c); + + if (a > b && a > c) { + System.out.println("The largest variable is: a"); + } else if (b > a && b > c) { + System.out.println("The largest variable is: b"); + } else if (c > a && c > b) { + System.out.println("The largest variable is: c"); + } else + System.out.println("All variables have the same value"); + + } +} diff --git a/Code/JavaOldCode/src/Archiv/Yoda.java b/Code/JavaOldCode/src/Archiv/Yoda.java new file mode 100644 index 0000000..847cebd --- /dev/null +++ b/Code/JavaOldCode/src/Archiv/Yoda.java @@ -0,0 +1,32 @@ +package Archiv; + +import java.util.Random; + +public class Yoda { + public static void main(String[] args) { + // Print text + + System.out.println("A code request you have made,"); + System.out.println("Fear not, for I am here to aid."); + System.out.println("In Java, a language so grand,"); + System.out.println("I'll lend you a helping hand."); + + // Creating a Random object + Random random = new Random(); + + // Define the range for xx, yy and zz + int minRange = -10000; + int maxRange = 10000; + + // Generate random values for xx, zz and yy within the specified range + int xx = random.nextInt(maxRange - minRange + 1) + minRange; + int yy = random.nextInt(maxRange - minRange + 1) + minRange; + int zz = random.nextInt(maxRange - minRange + 1) + minRange; + + int sum = xx + yy + zz; + + System.out.println("The sum of " + xx + ", " + yy + " and " + zz + " is: " + sum); + + System.out.println("May the code be with you!"); + } +} \ No newline at end of file diff --git a/Code/JavaOldCode/src/Archiv/exchange.java b/Code/JavaOldCode/src/Archiv/exchange.java new file mode 100644 index 0000000..0066118 --- /dev/null +++ b/Code/JavaOldCode/src/Archiv/exchange.java @@ -0,0 +1,33 @@ +package Archiv; + +public class exchange { + public static void main(String[] args) { + + int x = 5; + int y = 7; + + // Vor dem Tausch + System.out.println(x); + System.out.println(y); + + // Tausch + int z = 0; + z = x; + x = y; + y = z; + + // Nach dem Tausch + System.out.println(x); + System.out.println(y); + + /* + * Tauschen Sie die Inhalte der beiden Variablen! D. h.: Wenn vor dem + * Tausch x den Wert 5 hatte und y den Wert 7, dann soll x nach dem + * Tausch den Wert 7 haben und y den Wert 5. Führen Sie den Tausch + * so durch, dass der Tausch funktioniert, egal mit welchen Werten x + * und y initialisiert wurden. + * Sie dürfen nur Code zwischen den beiden Kommentaren //Tausch + * und //Nach dem Tausch hinzufügen! + */ + } +} \ No newline at end of file diff --git a/Code/JavaOldCode/src/Grundlagen.java b/Code/JavaOldCode/src/Grundlagen.java new file mode 100644 index 0000000..0b6d386 --- /dev/null +++ b/Code/JavaOldCode/src/Grundlagen.java @@ -0,0 +1,61 @@ +public class Grundlagen { + public static void main(String[] args) { + + // Hello World + System.out.println("Hello World"); + + // Zahlen Variablen + int x = 99; + int y = 2; + x = x + 1; + x = x + y; + System.out.println(x); + + // Buchstaben Variablen + char myA = 'a'; + System.out.println(myA); + + // If & else + if (x > 101) { + System.out.println("Der Wert ist grösser als 101"); + } else { + System.out.println("Der Wert ist kleiner als 101"); + } + + // Iteration + int anzahlDurchgaenge = 1; + while (anzahlDurchgaenge <= 5) { + System.out.println("Durchgang nr. " + anzahlDurchgaenge); + anzahlDurchgaenge += 1; + } + + // Datentypen + byte myByte = 127; + short myShort = 300; + + // With float the f is necassary because java otherwise treats it as a double + // (simplified anwser) + double myDoubleValue = 34.568956; + float myFloatValue = 17.567f; + + // Constant always uppercase // Fixed Number + + final double PI = 3.141592876; + + int xx = 0; + long yy = 2; + xx++; // inkrement + xx--; // dekrement + + xx += (int) y; // Making y (long) a int for calculation + xx += 1; // Short for x = x +1 + yy += 4; // Short for y = y +4 + yy %= 3; // short for y = y%3 %=Modulo (Ganzahliges Geteiltdurch) + + // Square root + double d1 = Math.sqrt(10); + + System.out.println(d1 + "noch etwas schreiben" + d1); + + } +} \ No newline at end of file diff --git a/Code/JavaOldCode/src/Testcode.java b/Code/JavaOldCode/src/Testcode.java new file mode 100644 index 0000000..7a532fb --- /dev/null +++ b/Code/JavaOldCode/src/Testcode.java @@ -0,0 +1,5 @@ +public class Testcode { + public static void main(String[] args) { + + } +}