From 8901dea11bf72bd3b7d031b914c07d5b4e4f24f2 Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Thu, 19 Dec 2024 07:51:04 +0100 Subject: [PATCH] Mittwoch lesson --- Code/Steiner/Zootest/.vscode/settings.json | 7 ++ Code/Steiner/Zootest/README.md | 18 ++++ Code/Steiner/Zootest/bin/Animal.class | Bin 0 -> 263 bytes Code/Steiner/Zootest/bin/Camel.class | Bin 0 -> 596 bytes Code/Steiner/Zootest/bin/Climbing.class | Bin 0 -> 119 bytes Code/Steiner/Zootest/bin/Eagle.class | Bin 0 -> 720 bytes Code/Steiner/Zootest/bin/Flying.class | Bin 0 -> 113 bytes Code/Steiner/Zootest/bin/Frog.class | Bin 0 -> 714 bytes Code/Steiner/Zootest/bin/Swimming.class | Bin 0 -> 118 bytes Code/Steiner/Zootest/bin/ZooTest.class | Bin 0 -> 685 bytes Code/Steiner/Zootest/src/Animal.java | 3 + Code/Steiner/Zootest/src/Camel.java | 11 ++ Code/Steiner/Zootest/src/Climbing.java | 3 + Code/Steiner/Zootest/src/Eagle.java | 16 +++ Code/Steiner/Zootest/src/Flying.java | 4 + Code/Steiner/Zootest/src/Frog.java | 16 +++ Code/Steiner/Zootest/src/Swimming.java | 3 + Code/Steiner/Zootest/src/ZooTest.java | 17 +++ .../.vscode/settings.json | 7 ++ .../finallyTryCatchAndFinally/README.md | 18 ++++ .../finallyTryCatchAndFinally/bin/App.class | Bin 0 -> 2245 bytes .../finallyTryCatchAndFinally/src/App.java | 32 ++++++ .../.vscode/settings.json | 7 ++ Code/Steiner/fractionsSteinerTask/README.md | 18 ++++ .../fractionsSteinerTask/bin/Anteil.class | Bin 0 -> 1120 bytes .../fractionsSteinerTask/bin/AnteilTest.class | Bin 0 -> 2006 bytes .../fractionsSteinerTask/bin/Bruch.class | Bin 0 -> 2894 bytes .../fractionsSteinerTask/bin/BruchTest.class | Bin 0 -> 2971 bytes .../fractionsSteinerTask/src/Anteil.java | 34 ++++++ .../fractionsSteinerTask/src/AnteilTest.java | 57 ++++++++++ .../fractionsSteinerTask/src/Bruch.java | 101 ++++++++++++++++++ .../fractionsSteinerTask/src/BruchTest.java | 78 ++++++++++++++ .../.vscode/settings.json | 7 ++ Code/Steiner/interfacesTwoTesting/README.md | 18 ++++ .../interfacesTwoTesting/bin/App.class | Bin 0 -> 478 bytes .../interfacesTwoTesting/bin/Hans.class | Bin 0 -> 481 bytes .../interfacesTwoTesting/bin/ISleep.class | Bin 0 -> 114 bytes .../interfacesTwoTesting/bin/IWalk.class | Bin 0 -> 112 bytes .../Steiner/interfacesTwoTesting/src/App.java | 6 ++ .../interfacesTwoTesting/src/Hans.java | 8 ++ .../interfacesTwoTesting/src/ISleep.java | 3 + .../interfacesTwoTesting/src/IWalk.java | 3 + .../.vscode/settings.json | 7 ++ .../paymentSystemWithInterfaces/README.md | 18 ++++ .../paymentSystemWithInterfaces/bin/App.class | Bin 0 -> 1018 bytes .../bin/BankTransferPayment.class | Bin 0 -> 1093 bytes .../bin/CreditCardPayment.class | Bin 0 -> 1192 bytes .../bin/IPay.class | Bin 0 -> 110 bytes .../bin/PayPalPayment.class | Bin 0 -> 1064 bytes .../bin/Payment.class | Bin 0 -> 279 bytes .../paymentSystemWithInterfaces/src/App.java | 24 +++++ .../src/BankTransferPayment.java | 12 +++ .../src/CreditCardPayment.java | 14 +++ .../paymentSystemWithInterfaces/src/IPay.java | 3 + .../src/PayPalPayment.java | 12 +++ .../src/Payment.java | 3 + .../tryCatchTask/.vscode/settings.json | 7 ++ Code/Steiner/tryCatchTask/README.md | 18 ++++ Code/Steiner/tryCatchTask/bin/App.class | Bin 0 -> 1926 bytes Code/Steiner/tryCatchTask/src/App.java | 28 +++++ Code/Steiner/tryCatchTask/test.txt | 22 ++++ 61 files changed, 663 insertions(+) create mode 100644 Code/Steiner/Zootest/.vscode/settings.json create mode 100644 Code/Steiner/Zootest/README.md create mode 100644 Code/Steiner/Zootest/bin/Animal.class create mode 100644 Code/Steiner/Zootest/bin/Camel.class create mode 100644 Code/Steiner/Zootest/bin/Climbing.class create mode 100644 Code/Steiner/Zootest/bin/Eagle.class create mode 100644 Code/Steiner/Zootest/bin/Flying.class create mode 100644 Code/Steiner/Zootest/bin/Frog.class create mode 100644 Code/Steiner/Zootest/bin/Swimming.class create mode 100644 Code/Steiner/Zootest/bin/ZooTest.class create mode 100644 Code/Steiner/Zootest/src/Animal.java create mode 100644 Code/Steiner/Zootest/src/Camel.java create mode 100644 Code/Steiner/Zootest/src/Climbing.java create mode 100644 Code/Steiner/Zootest/src/Eagle.java create mode 100644 Code/Steiner/Zootest/src/Flying.java create mode 100644 Code/Steiner/Zootest/src/Frog.java create mode 100644 Code/Steiner/Zootest/src/Swimming.java create mode 100644 Code/Steiner/Zootest/src/ZooTest.java create mode 100644 Code/Steiner/finallyTryCatchAndFinally/.vscode/settings.json create mode 100644 Code/Steiner/finallyTryCatchAndFinally/README.md create mode 100644 Code/Steiner/finallyTryCatchAndFinally/bin/App.class create mode 100644 Code/Steiner/finallyTryCatchAndFinally/src/App.java create mode 100644 Code/Steiner/fractionsSteinerTask/.vscode/settings.json create mode 100644 Code/Steiner/fractionsSteinerTask/README.md create mode 100644 Code/Steiner/fractionsSteinerTask/bin/Anteil.class create mode 100644 Code/Steiner/fractionsSteinerTask/bin/AnteilTest.class create mode 100644 Code/Steiner/fractionsSteinerTask/bin/Bruch.class create mode 100644 Code/Steiner/fractionsSteinerTask/bin/BruchTest.class create mode 100644 Code/Steiner/fractionsSteinerTask/src/Anteil.java create mode 100644 Code/Steiner/fractionsSteinerTask/src/AnteilTest.java create mode 100644 Code/Steiner/fractionsSteinerTask/src/Bruch.java create mode 100644 Code/Steiner/fractionsSteinerTask/src/BruchTest.java create mode 100644 Code/Steiner/interfacesTwoTesting/.vscode/settings.json create mode 100644 Code/Steiner/interfacesTwoTesting/README.md create mode 100644 Code/Steiner/interfacesTwoTesting/bin/App.class create mode 100644 Code/Steiner/interfacesTwoTesting/bin/Hans.class create mode 100644 Code/Steiner/interfacesTwoTesting/bin/ISleep.class create mode 100644 Code/Steiner/interfacesTwoTesting/bin/IWalk.class create mode 100644 Code/Steiner/interfacesTwoTesting/src/App.java create mode 100644 Code/Steiner/interfacesTwoTesting/src/Hans.java create mode 100644 Code/Steiner/interfacesTwoTesting/src/ISleep.java create mode 100644 Code/Steiner/interfacesTwoTesting/src/IWalk.java create mode 100644 Code/Steiner/paymentSystemWithInterfaces/.vscode/settings.json create mode 100644 Code/Steiner/paymentSystemWithInterfaces/README.md create mode 100644 Code/Steiner/paymentSystemWithInterfaces/bin/App.class create mode 100644 Code/Steiner/paymentSystemWithInterfaces/bin/BankTransferPayment.class create mode 100644 Code/Steiner/paymentSystemWithInterfaces/bin/CreditCardPayment.class create mode 100644 Code/Steiner/paymentSystemWithInterfaces/bin/IPay.class create mode 100644 Code/Steiner/paymentSystemWithInterfaces/bin/PayPalPayment.class create mode 100644 Code/Steiner/paymentSystemWithInterfaces/bin/Payment.class create mode 100644 Code/Steiner/paymentSystemWithInterfaces/src/App.java create mode 100644 Code/Steiner/paymentSystemWithInterfaces/src/BankTransferPayment.java create mode 100644 Code/Steiner/paymentSystemWithInterfaces/src/CreditCardPayment.java create mode 100644 Code/Steiner/paymentSystemWithInterfaces/src/IPay.java create mode 100644 Code/Steiner/paymentSystemWithInterfaces/src/PayPalPayment.java create mode 100644 Code/Steiner/paymentSystemWithInterfaces/src/Payment.java create mode 100644 Code/Steiner/tryCatchTask/.vscode/settings.json create mode 100644 Code/Steiner/tryCatchTask/README.md create mode 100644 Code/Steiner/tryCatchTask/bin/App.class create mode 100644 Code/Steiner/tryCatchTask/src/App.java create mode 100644 Code/Steiner/tryCatchTask/test.txt diff --git a/Code/Steiner/Zootest/.vscode/settings.json b/Code/Steiner/Zootest/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/Code/Steiner/Zootest/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/Code/Steiner/Zootest/README.md b/Code/Steiner/Zootest/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/Steiner/Zootest/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/Steiner/Zootest/bin/Animal.class b/Code/Steiner/Zootest/bin/Animal.class new file mode 100644 index 0000000000000000000000000000000000000000..13fa31a55c3eef0957cb02549f9c417bbaf2b9cd GIT binary patch literal 263 zcmXYs%?`mp6ot>NQtGd~fgKk507N1ZtA+)!pVow-ohDV@%SvM50X!7$s7dCWx%1td zGxK^so}Ulq=s2(lm6=wFh#lAj?d*tMDkJobg0yl}`z!{$NY6=jl$mD52Is z85Kf1P+Bf8Nhq_82xCd;25BVXt;m$A|Ce@tP-j9lDALA+S|UzzonG{g;Ie0tTqrYN zFIq<>4LG+Yh^}27`B?kd-#(rOhH=^%JLa7rBgx3?HO5z_d7vHLgV0Kc$7Qynx zz3c{KJ+x55s);gT`A$5FrYH2M*?o#)={u;P%F@9&CR93US_RGPQ0cfEhf?^h0@exD z3mM5Uc2jb96!JKpjA}MEv29|DP@dE3U#LB@{X0E6tiuxH@UJUa(SHd&R~tfz2r($EC&}5^F}XH=o3vLt=5MJ(pyk IB{Dep1_In}Gynhq literal 0 HcmV?d00001 diff --git a/Code/Steiner/Zootest/bin/Climbing.class b/Code/Steiner/Zootest/bin/Climbing.class new file mode 100644 index 0000000000000000000000000000000000000000..6c59e2b279b556b37ff8ab16cd0490ba36a67596 GIT binary patch literal 119 zcmX^0Z`Z#6{~4SaIN2GP7#TR6b24+2GV{{e8CVz@1hNv#67_Qu^V0SGld@8iOBfkg zlR*j?8JIOR!x$O3g7Zs@l2hF>b5a=@cwu_=K-$Zw`-4-4)?sljLNu`!AwbBmK9*X1pXX&CDOabw zlrCN+TQ-x1!5dfRBZeU7mts=P^?872ccAA$IZB!yAUJnvw{6h^dvIj-oVy`%CiD*it$j zxwkfFYT@G@!|oD4Q&N~XlW7)99otOA=5mqHObkuS#|MUkl~9_Dlq=B{x1x;uPGpiK z8Bj$?4=<)B1#>A?=Lz_NPCHe$%0WF0Gv^NgqMy zXeq!3o>D|#@lgDk)UG(V#@6P}4PHM2Lb`HZKDj Of~?m@ zDuJYiW*8#_S8#r5QF5wVW=<+212;sU9!LutBLh$k0|+nzjbUYA1F;y`fg}?H2LJ;s B7=i!* literal 0 HcmV?d00001 diff --git a/Code/Steiner/Zootest/bin/Frog.class b/Code/Steiner/Zootest/bin/Frog.class new file mode 100644 index 0000000000000000000000000000000000000000..d06e13b05d01847806ee7fc31be34784dbfbf7e7 GIT binary patch literal 714 zcmZvZ%T60H6o!9?By(Z7L%9{0luH8(vg{%V2}OcUgpg9PcM>bO%y`hu1jJ*N1xPG- z03NFJcY=V$Y;2#~_n&k8`tSMW?F}vLJ17a1Pt#=Jpe#^5F*=r!gQ|erxzlm14I?hC zR;1%DEhZglqw`~diTeH}t6NE5`Ix{|01v*vOj{duK8(96{VltZ5}0o%JsDlfR9pMq zSW4MaV;*k1vb8DSZ5Y$6XsVcyh%*|P@vMYD|4|Yu=*u+$vqCx3wNV4Q$i%+caTK8k-a z+ZKBdSeRdZ#QG<|XUJ-~RQ-f_ACOux=Z+G3n0^k%oIX?vdb5a=@cwt)gK)To%8Gx!7K!6cw5-S56h{eDTB$*gE E0OX|_zyJUM literal 0 HcmV?d00001 diff --git a/Code/Steiner/Zootest/bin/ZooTest.class b/Code/Steiner/Zootest/bin/ZooTest.class new file mode 100644 index 0000000000000000000000000000000000000000..a3dead681e059cdbcccb6a93a7bb256b8a0bdcf6 GIT binary patch literal 685 zcmZuvO>fgc6r4?*IyQy|0tHG5G$kczk_HgBR;VbVa4_Z2DiUzoq^{ZG56N*s{46f1 zL=eiEA4Qo*BK3kLzt4GZX1)IX=f|&$3-s~SMnS>;kfuk$IJaRbR8I95-HUV*_TCLo zgHf)qv}+QRzfdSPTLT5FpB@J;if}xXu%xi;nJ+-VJLTvsT)(qTlp3LF&|hWd;2M@$k>Q_QX3@WyqVoQn zcha7q+Mb~@!JWCgH${z|hi^OVbY`ecus(P7DH`lNKIpR3ouM&7^OFA=*+9W%?w5a{ zN=2*8>g3;qi!PNtr=DG^*`uD 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/Steiner/finallyTryCatchAndFinally/bin/App.class b/Code/Steiner/finallyTryCatchAndFinally/bin/App.class new file mode 100644 index 0000000000000000000000000000000000000000..4722d62bab2833dafb4bb91d849a3901727b798c GIT binary patch literal 2245 zcmaJ?ZF3V<6n<`#bknfVHZ9OXTR@?v1&Jsl+VElUMKUmTq>#?uJst zcW0b&WYll^3-~I22n>$;-CyFb5TBcbHZjr8bniXqo_p?jp7Y$BKmUIA`}5~W<0}mv z0-?!LNkdqm=eBXzNZN*zPhMWTEzLln^R(qy!C3|+#+C%aX*VZh2%$?y1f2ri8OxD# z<>H$37L7Gq3dA$6Y1m7KXDPex3qdRElYehUEzCNvvkJkIV+1<>XW9nArJy zrYr@P>-ZYt0)5+2TPt1Y#~uy4o662^`hhI!*oy&{?3RgOckKwvP0llaz*D4AOvSJd zLmKus@2*y$V;CbuZc8U06spK)VmOGGG#q+SN^>?HFXOO)R#FGp1Qt%rj4j15iiCz& z1ctZEpY*JtP?UjXZUNCThH+xf%V1XezL6)1{fV(wX5s*j>39{#1@;z=b(wY@(+HNC zkuyIqoPZpUCR%s4Nv06JrV2knirQ^iisB7+Y;x-I!eWFc^Dp#Q45#q6hPRq%TP%>$ zoQ?^wwGrQzvZN@us3;IPqvNbnO2o9K;l>u&IwYYSXozpaH47A^x2}n*(zp7+wVm0(FxO{|QdPDZrZilB(ei3A zp}HGN*HK(y!(IQlV-$HI`jOSKs2a0_ZJhVqlJtVjD5zy^*>ZC3hOZQNO~(qZ3q(!V z33vsFet#qP>4M>9<(;y0Oqm+HuHlBjz_xgp*Q7$G%9fpzUKH#fLr-YD7HQ<-YKWAzki!?v?lAXD9)xEsaC?7=Omlsj=y2RT}Y-$vf%!L1cOc&VKLj*Uc&%=Awmn2p9rI)jP2r{7!Ht#Bw?Q->@)PHNyd57ah1NC^qKTo zBxaqqPkWR01H|zu?XPJ+r2Rems&w)dR77DCQye?+9kablA|v>gIj8B-@D1MMEW~qr zZ~-%{=saf^af!1Gca0$OoRGpAW(kTS5*kLOhF<>9?e1aK>XcfCf37$4T73Q~7UEYc zSpEs)zhZTz^Ed2U3B_+_SHkfRvMZ6ek$nQQ0$G7oL2>yJMpan27UunXvFp-!1?QF@ zSLHE>E5ul1a)b!L-`<^M^aKWRk{r%q2n#HExyoftR13tcFrkVmiqOd$gb-mCzsgL2 aGRIwH 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/Steiner/fractionsSteinerTask/bin/Anteil.class b/Code/Steiner/fractionsSteinerTask/bin/Anteil.class new file mode 100644 index 0000000000000000000000000000000000000000..727851e6ebda4a489c8e367c3981008b59a58f97 GIT binary patch literal 1120 zcmZuv+fEZv6kUf-JMDDJrGOVeDPEu*g$jxnT2U^+5Gyg(G|{)AJ!wbVDVa_&@*}?a z3o0fxQDb6!^P|LdW(xS=!<;#1@3Zz=d+qc4&(|MEN7%pv9RmWfHP@F;Q->xHUH7`x zhCqB@dMfA(=%pZ5V6a$iIGbCm=HhD<~e ze_h|6POf8*5rZHvYT(%LZEarfeV<{ago4R_P(8O+HO5xe%tY7%R~kSt;^9(yI-OsHCBetl=3 ztnbwQ%;JK9tC-UT4>6U#)Wel9 zX)$R^Icm_|B9$pe?*}(m{{rgB$$bC- literal 0 HcmV?d00001 diff --git a/Code/Steiner/fractionsSteinerTask/bin/AnteilTest.class b/Code/Steiner/fractionsSteinerTask/bin/AnteilTest.class new file mode 100644 index 0000000000000000000000000000000000000000..2e582a2872cb10a22b09bbc44cf5aff184a2568d GIT binary patch literal 2006 zcmaJ?OIKS}6#fo*+z^7$P-tlpL!}r}X!<~GNna4eqJh>DsaRh($!T&)axdO{lM1ss zapb_6KR|zgt|e8vmJ^-m%!wmM4*Ux`vVP~@WC4=pAp7pK&$l1v+xwjS^3UE6&z>QR zk2Q1&MCVOc8nwK1Tn#~i{!P89r)#=dPTwhP%AzX}zGj$)dqW_QoLmAUoF=`ZzqCV~?Jr&Fm^V!rXP ztQTZr!EO{Q32B#q{LKiwfS3HRe+(mdUO?MYA!{shFxja_4KE0UyvR|E zVob4ehL+^=^5nX*jK^>m6AYx6N`|z_Pk%D!;WLx1uYx6Gm{fH3mu0mf?HyNdIAvLo zW(4O1pdiyRoJU%qrzCfbx?X!EZ62O&SyU&vs0zMBN|TFz;+Ys;R*8F@M!~i9ib@{A zE9}ofPW*NR5a_+7VUF$g4N+Xhm=f1xxPhAjy#+;H-twCxa6CDAl#V!n`4|?E6*y7X zt1@euMcut`xD{%StD7!oV4@R|M}w*C({Ttasfe$s1}t{W*@gKy2XaX{yb(hVD`dMY z-FuvBfo>M+)2%qX9!F5YLs%kJx?N^H109BsM0f|j$WSf!wuv13dzahF46`()UAJUe za!|yw>b7^W=pJcJJg2>7WPs?J)v$|l$x!#D&!=2n!t-hnIRp!q_G% zM^QsTV0{0c7-rL|%Cz4RpXnvN=vwx+BCI6v#X+K5Xg}a>-7M9lGoG`oYGW&Nl>7sh zLyr0FE!hEnkU{_9;BX(QG^^KYYlbT`ePMhUL0RCKfAmC)t+|AVz+k5rBoALsG%fSc zR`tIgmpqSpCl7ziBI{}nJlsbdW3?!F(P`p)v}~Hv&en9tk&Xt=%h@AkccM%~Q(*M} zp&SpNUyN~z1H2nR7d1Yclp0rQetEeONV0?hY4^W^#3RPhHda~w8)011UiH#EHputGP{{kJ8;F$mb literal 0 HcmV?d00001 diff --git a/Code/Steiner/fractionsSteinerTask/bin/Bruch.class b/Code/Steiner/fractionsSteinerTask/bin/Bruch.class new file mode 100644 index 0000000000000000000000000000000000000000..315d4a6269a2ec791db346305bb0fe27093b5953 GIT binary patch literal 2894 zcmbVOYi|=r6g`uN9Y1255JDk|Ng+_j5X`gC=25VLl9Gf+QXoKqwLOZLY<5$7O-cR$ zf1#>Wso(mcNVHXfic0+f{X_j!=()R_jUk~zl{LF}#&^y=_uM;U|MlwSpRZq|glZIR z3Z2Dzvr>zqLm~6PcxV(X!(J?0E)GaVS=Z-{vZWPzrk#pmT{r5c%!9=a zw`MjNc-rGNM)2H}#88jOH8saD}W~ve3pdSt#s_qkyAP98uWr z(R|YKj4R@qMyAF}f8JY;SB@V@XY-WGgkICz)v`#7!h z{9f^$&c8q+-~J5U`Hp8u|H7p2|^|b)=kKi2ieDs+!jKn(Z|5Tjtv}uFVIKw^7(q;16%OT5PX}*G(|Y!JLGTM z0z8cm7)CGy8mmQFA8R+U`rm;y5MT`= z8>C<0TLkIM|Ay`-H2fm@DrG$wzc8I4r9E42PQSf*@0Oc~yhf5nIn7WKIVF)f(l4dA~P!Sq1!ytb(BQ{)&$_fJTAmIQ+KCdG0^hg4Y}3@fr;9UJy_E^R$5d zj+5iUjPHs5ftAT0kr)^s^vuEUU;mw7pwECM{YWb8ZRQJK!Zd$GnPV_^TwfYa_}q#%Z-?uZQ33^|s^`_p*~?_&F{Hv409;7bT9w zm&lAZBXi**EI6M%#3V;K4smUi;|FADrfH^sKxfC3cIiyNCUVXsMut&_FhwoDpt6@* zcosvRMP3%dGs8Mf(Q4z4z4Y%5v`;|&gELW3d(rw*DB7cdcrFkvT@$v#zIOk8FR9&r`pRk2#uc an8%lVr)b?~v^&A`F4yG$$~_pUVAsF>-rH{g literal 0 HcmV?d00001 diff --git a/Code/Steiner/fractionsSteinerTask/bin/BruchTest.class b/Code/Steiner/fractionsSteinerTask/bin/BruchTest.class new file mode 100644 index 0000000000000000000000000000000000000000..bba17475d94b8df02b0675852238027a75fbb2df GIT binary patch literal 2971 zcmaJ@OK=ob6g_W#Ju~Tq$%FtwK)`?*0t5&Uk^lk;|KVpaNI<1C(`1^=C(QJKiT^L6 zqNu3&S5RDO6)r+mQf0Zc*z1zL8_Nwl70-J;J()2nHn-pXy?gF`_rBM+|DE{x-aYi- zdkr3e(2jgDkveJ?Yz;nv$Qk3D(Uvx{Lv4o!&zK2YAh6lWTJ}}}Z%eFSz}J&Ynqhbm z(&0xyU{>79ng@%SK{J2U7)+Z2(ReOlr2CD$CHa!jXQ!-!Kux?Hu$!A@3@a-zr{zR^ zDsZ2jx3WXsv3?Ep0u4%0w5@d8_I%zLjavmfj0i#+W()Y$ZecVaB!zQz%tI5Q8p)(U zV@t)ZPCDJOfe;?RLJbS5lI$x6visFX;|%+uQ~}GYp_;88ujfHA z$^Iw=Vp7^6rJGp&mc2^sam3v^Hp`BP44K14Ge2e<#lny|XlA2q7v=bfj%{+gaKW?( z3^SEB^K!o(I{T605XA@0Y}U+2;X^FSC?o;LcaM&}*vD#SifP*#Nn2xgri2WC8w5ROQ6kLl=_fi*Uj3>ih( z+5fnX0ja1d6bJ3Rk#dwZj`9f|PvR*mljfL}G1BMFJe!3x)Ek8kLxvudp?hZxT?-?M zIvA|Hksl)Th8ZS=kl0yfBE>3{y0v;vIAH&qEyV&S1I^2ak z<3cf$VF1UrlZTYFPM>BOvSR|G*TIlTtz9FaSERbGtYD{AD%v^j)%U~bh ziOnV8TbWI`FIUVb%w3keX6n@J%d2a(yd&5NJ90U@z>^p`VA`o%vJl4ecu~U(0?kv` zi8#ddVHg|?>myxh@`B8Z$F9}?&oUxL%v*8{in@pR9=6EhQTpa11K6e$8D#xSD zaR&3sGd-lPTQ>1Dq&-GD-DlZm_pAV(3*uECflPYw+OEYSh}T_qonqf`*>=Ug>9Xq; z`?kw&Q0zM{yHT;1UA9B9@4M_K#a?mQPQ`x2({Ny{QT)|1@8J5h%saq7FY^wvFU!0G z?dvixv9V|N%6p(EZ4?S-LBn-{Wz#A%)2V3qPGHgfP1()P5n>6iG%s&nz{3^aGg6IQ z8^3~I|B71(-c;%^sZ@gwHKe*@z;7+N5T|t(C3N;qa-#@?z&KVai@+_cb4`2|CL5+qv`Fw4Ho8Xs3ZqWPs4VJITSoq_ zatKs7Y;hdQqOR7GZ-k<)WhOL^?Gkf&V`A=|7OSLXV)yslS>;LdX?yQd7P4S|)??!V zH}J}F>^?{!t5ntYS6g-Yq=Ocb9$kJ~HTjwdDL#S2Wka7|Dg%y^DN@-trPQQSqnkF4 zqg_F16;zRqm2CpbCPW+7Pf>Hr@gLj+{h2@`&O&G~yEG z;5z2gem*Aoqw^~k;0_kz4=l!AED;_o74xu6G-J8wLQM2xg*d`rj#K zMpSY@t`QrD047e83wk;+gcJm0{sRkV`1g4Pe_@y_FJu3XG*><%xQz@~eq#6mS*`*^ zaTz(TG-A1c5w3znlg3%DLd29{{$~&-syH9r0&0kBJ#5NqiEb5&l+_VmBhFD4A<8q`N6PX-j2i+)FUW`%Z!83T4-;*5bmnnTk(bp8cpy)+K-%|9FqVFpDo}wQp`k|s9 aEBc9|pDFr<~MhJ8FYxov7(DWZa1G7H> literal 0 HcmV?d00001 diff --git a/Code/Steiner/fractionsSteinerTask/src/Anteil.java b/Code/Steiner/fractionsSteinerTask/src/Anteil.java new file mode 100644 index 0000000..e92dd14 --- /dev/null +++ b/Code/Steiner/fractionsSteinerTask/src/Anteil.java @@ -0,0 +1,34 @@ +public class Anteil extends Bruch { + + private static Bruch verteilt = new Bruch(0, 1); + + // Standardkonstruktor: Anteil = 0 + public Anteil() { + super(0, 1); + } + + // Konstruktor mit Zähler und Nenner + public Anteil(int z, int n) { + super(z, n); + Bruch neuerAnteil = new Bruch(z, n); + verteilt = verteilt.addiere(neuerAnteil); + + if (verteilt.dezimalwert() > 1) { + System.out.println("Fehler: Der Gesamtwert der verteilten Anteile übersteigt 1."); + verteilt = verteilt.subtrahiere(neuerAnteil); // Rollback des Fehlers + setZaehler(0); // Setzt Anteil zurück + setNenner(1); + } + } + + // Methode, um den verteilten Anteil als double zu erhalten + public static double getVerteilt() { + return verteilt.dezimalwert(); + } + + // Methode, um den verbleibenden Anteil als Bruch zu erhalten + public static Bruch getRest() { + Bruch eins = new Bruch(1, 1); + return eins.subtrahiere(verteilt); + } +} diff --git a/Code/Steiner/fractionsSteinerTask/src/AnteilTest.java b/Code/Steiner/fractionsSteinerTask/src/AnteilTest.java new file mode 100644 index 0000000..456c9e2 --- /dev/null +++ b/Code/Steiner/fractionsSteinerTask/src/AnteilTest.java @@ -0,0 +1,57 @@ +public class AnteilTest { + public static void main(String[] args) { + + // Bruch-Test + + System.out.println("*** Aufgabe Bruch ergänzen"); + + Bruch bruch1 = new Bruch(1, 2); + + Bruch bruch2 = new Bruch(3, 4); + + Bruch bruch3 = bruch1.addiere(bruch2); + + bruch3.gekuerztausgeben(); + + System.out.println(""); + + System.out.println(bruch3.dezimalwert()); + + Bruch bruch4 = bruch1.subtrahiere(bruch2); + + bruch4.gekuerztausgeben(); + + System.out.println(""); + + System.out.println(bruch4.dezimalwert()); + + // Anteil-Test + + System.out.println(""); + + System.out.println("*** Aufgabe Anteil"); + + int vermoegen = 200000; + + Anteil anteil1 = new Anteil(1, 4); + + Anteil anteil2 = new Anteil(1, 2); + + System.out.println("Anteil anteil1: " + anteil1.bruchToString()); + + System.out.println("Betrag von anteil1: " + vermoegen * anteil1.dezimalwert()); + + System.out.println("Anteil anteil2: " + anteil2.bruchToString()); + + System.out.println("Betrag von anteil2: " + vermoegen * anteil2.dezimalwert()); + + System.out.println(""); + + // System.out.println("Verteilt: " + Anteil.verteilt.bruchToString()); + + System.out.println("Rest: " + anteil1.getRest().bruchToString()); + + System.out.println("Restbetrag: " + vermoegen * anteil1.getRest().dezimalwert()); + + } +} diff --git a/Code/Steiner/fractionsSteinerTask/src/Bruch.java b/Code/Steiner/fractionsSteinerTask/src/Bruch.java new file mode 100644 index 0000000..5900b87 --- /dev/null +++ b/Code/Steiner/fractionsSteinerTask/src/Bruch.java @@ -0,0 +1,101 @@ +public class Bruch { + + private int zaehler; + private int nenner; + + Bruch() { + zaehler = 0; + nenner = 1; + } + + Bruch(int x) { + zaehler = x; + nenner = 1; + } + + Bruch(int x, int y) { + zaehler = x; + nenner = y; + } + + void setZaehler(int z) { + zaehler = z; + } + + void setNenner(int n) { + nenner = n; + } + + int getZaehler() { + return zaehler; + } + + int getNenner() { + return nenner; + } + + String bruchToString() { + return zaehler + "/" + nenner; + } + + void ausgeben() { + System.out.println(zaehler + "/" + nenner); + } + + void kuerzen() { + int m, n, r; + m = Math.abs(zaehler); + n = Math.abs(nenner); + r = m % n; + while (r > 0) { + m = n; + n = r; + r = m % n; + } + zaehler /= n; + nenner /= n; + } + + void gekuerztausgeben() { + kuerzen(); + ausgeben(); + } + + Bruch multipliziere(Bruch m) { + var z = zaehler * m.zaehler; + var n = nenner * m.nenner; + return new Bruch(z, n); + } + + boolean equals(Bruch x) { + var a = new Bruch(this.zaehler, this.nenner); + var b = new Bruch(x.zaehler, x.nenner); + a.kuerzen(); + b.kuerzen(); + return (a.zaehler == b.zaehler) && (a.nenner == b.nenner); + } + + // Neue Methode: Addition + Bruch addiere(Bruch b) { + int neuerZaehler = this.zaehler * b.nenner + b.zaehler * this.nenner; + int neuerNenner = this.nenner * b.nenner; + return new Bruch(neuerZaehler, neuerNenner); + } + + // Neue Methode: Subtraktion + Bruch subtrahiere(Bruch b) { + int neuerZaehler = this.zaehler * b.nenner - b.zaehler * this.nenner; + int neuerNenner = this.nenner * b.nenner; + return new Bruch(neuerZaehler, neuerNenner); + } + + // Neue Methode: Dezimalwert + double dezimalwert() { + if (nenner == 0) { + System.out.println("Error Divided by 0"); + return 0; + } else { + return (double) zaehler / nenner; + } + } +} diff --git a/Code/Steiner/fractionsSteinerTask/src/BruchTest.java b/Code/Steiner/fractionsSteinerTask/src/BruchTest.java new file mode 100644 index 0000000..9f3fb6c --- /dev/null +++ b/Code/Steiner/fractionsSteinerTask/src/BruchTest.java @@ -0,0 +1,78 @@ +import java.util.ArrayList; + +public class BruchTest { + public static void main(String[] args) { + ArrayList brueche = new ArrayList<>(); + + // Test 1: Standardkonstruktor + brueche.add(new Bruch()); + System.out.println("Test 1: " + brueche.get(0).bruchToString()); // Erwartet: 0/1 + + // Test 2: Konstruktor mit einem Parameter + brueche.add(new Bruch(3)); + System.out.println("Test 2: " + brueche.get(1).bruchToString()); // Erwartet: 3/1 + + // Test 3: Konstruktor mit zwei Parametern (positive Werte) + brueche.add(new Bruch(4, 8)); + System.out.println("Test 3: " + brueche.get(2).bruchToString()); // Erwartet: 4/8 + brueche.get(2).gekuerztausgeben(); // Erwartet: 1/2 + + // Test 4: Konstruktor mit zwei Parametern (negative Werte) + brueche.add(new Bruch(-4, 8)); + System.out.println("Test 4: " + brueche.get(3).bruchToString()); // Erwartet: -4/8 + brueche.get(3).gekuerztausgeben(); // Erwartet: -1/2 + + // Test 5: Setzen von Zähler und Nenner (normal) + brueche.get(2).setZaehler(6); + brueche.get(2).setNenner(9); + System.out.println("Test 5: " + brueche.get(2).bruchToString()); // Erwartet: 6/9 + brueche.get(2).gekuerztausgeben(); // Erwartet: 2/3 + + // Test 6: Setzen von Zähler und Nenner (mit Null) + brueche.get(2).setZaehler(0); + brueche.get(2).setNenner(9); + System.out.println("Test 6: " + brueche.get(2).bruchToString()); // Erwartet: 0/9 + + // Test 7: Setzen von Zähler und Nenner (Division durch Null) + brueche.get(2).setNenner(0); + System.out.println("Test 7: " + brueche.get(2).bruchToString()); + + // Test 8: Multiplikation + Bruch bruch4 = new Bruch(2, 3); + Bruch produkt = brueche.get(2).multipliziere(bruch4); + System.out.println("Test 8: " + produkt.bruchToString()); // Erwartet: 0/1 + + // Test 9: Gleichheit + Bruch bruch5 = new Bruch(2, 3); + Bruch bruch6 = new Bruch(4, 6); + System.out.println("Test 9: " + bruch5.equals(bruch6)); // Erwartet: true + + // Test 10: Ungleichheit + Bruch bruch7 = new Bruch(1, 2); + System.out.println("Test 10: " + bruch5.equals(bruch7)); // Erwartet: false + + // Test 11: Addition (positive und negative Werte) + Bruch bruch8 = new Bruch(1, 4); + Bruch summe = bruch5.addiere(bruch8); + System.out.println("Test 11: " + summe.bruchToString()); // Erwartet: 11/12 + + // Test 12: Subtraktion (negatives Ergebnis) + Bruch bruch9 = new Bruch(3, 4); + Bruch differenz = bruch5.subtrahiere(bruch9); + System.out.println("Test 12: " + differenz.bruchToString()); // Erwartet: -1/12 + + // Test 13: Dezimalwert + double dezimalwert = bruch5.dezimalwert(); + System.out.println("Test 13: " + dezimalwert); // Erwartet: 0.6666666666666666 (2/3) + + // Test 14: Dezimalwert eines anderen Bruchs + Bruch bruch10 = new Bruch(3, 4); + double dezimalwert2 = bruch10.dezimalwert(); + System.out.println("Test 14: " + dezimalwert2); // Erwartet: 0.75 + + // Test 16: Dezimalwert eines anderen Bruchs (null) + Bruch bruch11 = new Bruch(3, 0); + double dezimalwert3 = bruch11.dezimalwert(); + System.out.println("Test 15: " + dezimalwert3); // Erwartet: 0 + } +} diff --git a/Code/Steiner/interfacesTwoTesting/.vscode/settings.json b/Code/Steiner/interfacesTwoTesting/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/Code/Steiner/interfacesTwoTesting/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/Code/Steiner/interfacesTwoTesting/README.md b/Code/Steiner/interfacesTwoTesting/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/Steiner/interfacesTwoTesting/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/Steiner/interfacesTwoTesting/bin/App.class b/Code/Steiner/interfacesTwoTesting/bin/App.class new file mode 100644 index 0000000000000000000000000000000000000000..c8204afcec956e3c028fb1c6f1f40d95745da253 GIT binary patch literal 478 zcmZut+fKqj5IqZpmdZ`4c-Q!bn#c!WObpRz(&z(*#Q3z-1{O<8N>P8y7fCen1NH4PT%(uf$WJ2RdULr z+Cf{uXhsjdjWlw3WRMjoxhnLp$AgX^-^xzl3sl_5lR;a?O2@xRBk8G;K*pt1gERxF zLV;@S-d#wxl30b^hL*9v|~TSq6`E zGVW5;`A39ckDc7l)eIcTZbjqR^DmU%!Qz<5S`+)=>d+^}7gwe=8P(|pedcfi>vaa( zv>FEQ5^a87Kwn^#LlGsCl=(J@EYE1Jm`O2H_<(aa!K!=ohU$W@IMYtUVvGK8OGFK9%+WEm&#SKd!49A`#O;#Y!tCU z9HZFA7Irwc87lugbg+v(20k#eK}5LvgqNOAFctM0<~G}pM@d(nD|3ZqgdQ6lY9JxV zAP)|ZrzUK&bCkK{8TtItJDiuay+F2*7U_2=b|w!{!V+clKhxop6b4wYsFc^=usH+R T)FLX1gqlIDDWpc-4EBEjkoj6} literal 0 HcmV?d00001 diff --git a/Code/Steiner/interfacesTwoTesting/bin/ISleep.class b/Code/Steiner/interfacesTwoTesting/bin/ISleep.class new file mode 100644 index 0000000000000000000000000000000000000000..1beb614e90456a01cfbb85f1c051dc651f7c071c GIT binary patch literal 114 zcmX^0Z`Z#6{~4SaIN2GP7#Y|+gL6_-3)mT07#Rez63Y_xa}x8?_5G8wQj<#<8Cc2_ zbFvv3m^C!R7#X;N^Gl18Q{6IiQW+VzAsY2Sde|5lfNB^(fDvd8D+3#d#lQ|EnHV?# D7bh5* literal 0 HcmV?d00001 diff --git a/Code/Steiner/interfacesTwoTesting/bin/IWalk.class b/Code/Steiner/interfacesTwoTesting/bin/IWalk.class new file mode 100644 index 0000000000000000000000000000000000000000..12178fcc9258b8ca065eab2af7753bdda40c3ecc GIT binary patch literal 112 zcmX^0Z`Z#6{~4SaIN2GP7#UbS!xM9|*%??E83eKt%M$f-67$ma{gbj%lS>#GSjvHt zj10^gnqiC#T*3LJMaijdnK`LI4p^TaNDCVy15gPA2rvSTVP#+gu^8BaBohM%0K@PX A!vFvP literal 0 HcmV?d00001 diff --git a/Code/Steiner/interfacesTwoTesting/src/App.java b/Code/Steiner/interfacesTwoTesting/src/App.java new file mode 100644 index 0000000..67852e5 --- /dev/null +++ b/Code/Steiner/interfacesTwoTesting/src/App.java @@ -0,0 +1,6 @@ +public class App { + public static void main(String[] args) throws Exception { + Hans hans = new Hans(); + hans.walk(); + } +} diff --git a/Code/Steiner/interfacesTwoTesting/src/Hans.java b/Code/Steiner/interfacesTwoTesting/src/Hans.java new file mode 100644 index 0000000..7087be1 --- /dev/null +++ b/Code/Steiner/interfacesTwoTesting/src/Hans.java @@ -0,0 +1,8 @@ +public class Hans implements IWalk, ISleep { + + @Override + public void walk() { + System.out.println("Walk"); + } + +} diff --git a/Code/Steiner/interfacesTwoTesting/src/ISleep.java b/Code/Steiner/interfacesTwoTesting/src/ISleep.java new file mode 100644 index 0000000..a0325a4 --- /dev/null +++ b/Code/Steiner/interfacesTwoTesting/src/ISleep.java @@ -0,0 +1,3 @@ +public interface ISleep { + void walk(); +} diff --git a/Code/Steiner/interfacesTwoTesting/src/IWalk.java b/Code/Steiner/interfacesTwoTesting/src/IWalk.java new file mode 100644 index 0000000..88cff8e --- /dev/null +++ b/Code/Steiner/interfacesTwoTesting/src/IWalk.java @@ -0,0 +1,3 @@ +public interface IWalk { + void walk(); +} diff --git a/Code/Steiner/paymentSystemWithInterfaces/.vscode/settings.json b/Code/Steiner/paymentSystemWithInterfaces/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/Code/Steiner/paymentSystemWithInterfaces/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/Code/Steiner/paymentSystemWithInterfaces/README.md b/Code/Steiner/paymentSystemWithInterfaces/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/Steiner/paymentSystemWithInterfaces/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/Steiner/paymentSystemWithInterfaces/bin/App.class b/Code/Steiner/paymentSystemWithInterfaces/bin/App.class new file mode 100644 index 0000000000000000000000000000000000000000..9fda101a0def40413faaf2c49fa0397f21a67d62 GIT binary patch literal 1018 zcmZuw%T5zv6#jl_J7p}lQtAbSB5F&arS!r@Knn%qq96v+NObd4MjY%+C)25c2XO7q z7w`$(SR#oFm%e}x;o7C(H>D{iFv2VY;M+%TLL{B@+h)V zuQ{4+NYhj?fIDs_Ljuv*)m*OLOq3Md73e10maMcnN7)HO9_6(oX;>94S*{u?hB4-1 z-xCkFRo3LeEG~@>+>&l*_VHL{yO&O$43rB z+6SD?z%{erB+Bgu3v{)ixEPi^wq!*hu=ig9Di*M);E{mRVhvyk%UmCZlPbm>=%eAz ziYU^k)?G!ck!!nJx69g7-CZL;Hznzg9b+u76YkSVja$c4p*2k@D82Cp{9mYaK;`MW z!S@Ewz(oLMH?1!8pqEj7)IId{H(@?e_wZ)+6a%}#!QjmXZWm86yc-;8AhL0a@!jBq z2BMpjA;eA)p9&#Kkq9A0amhQR)BVvKK=-d zo~7178O9tn{$cJw>2phcOxtaNFCP7h`AbffUjQLCCEUahH*Fu|bG&zZ@dSBd2&~ZR G!0JDQ{?Ro6 literal 0 HcmV?d00001 diff --git a/Code/Steiner/paymentSystemWithInterfaces/bin/BankTransferPayment.class b/Code/Steiner/paymentSystemWithInterfaces/bin/BankTransferPayment.class new file mode 100644 index 0000000000000000000000000000000000000000..2a50e59057fd3dd6a71dec0c7570280969e43c5e GIT binary patch literal 1093 zcmaJ<+fExX5Is&p7PebLpcLqJX}Kh!CB0vist*K3Af+u5h(7em1eciX+R?5TDgBcE zMyp;V9{K_OsM2u~L8?U6%J$B9=FFVq`Tghg*V!4Wc= z4l)eRxsheaY?H+>8H+{|Nz-|oga;yGn64l56J8FuIx6p)NUEa>L-v(a(!6GvEeu~5 z_X(}44~2^~E_;~3BtyDT+@Ao$lm`dn47s{gqE};&9|Xb{(hVN$^GI5|@64E{jHyh0 z1PAIP-L^ev3Y!*u9@iW!P>F$tJFyX=hwHdO!8$P(s(USUd56dtq9k}&nFesn!)^Es zb0Keus#Xnd-b>S@zu0hPsEyUa<_NmOE*E#OhsmVi~DC&)E zGPt`si5j9NttRs$Xs=sHV!5HUiA}`YZ-i;;!`Q_=tUI{Ruyi4SR42M6`VZIRRO1b! zqmCt8X81h#fc@wm;1*YhfryvtTDOvRWtioF=byyAPFsu!|1c2$?%-H7Or<#B>O)j{ z5bR1LD!DAy#_@<@WkY=8%^*=n{)tvT^Q&7mKa|F|+7SQlSo@5@+g3_M)quybh#fp- zSRN8$6g3CW8E*YQlpd+40~TqB)3nBD!Ok-6Df*v)OZz3VYGkMAbW1dTu=#V?JXWwuaA_0>D1{stJg8EWpqZUkL8Ir})-Y|%p1p}FIb;H6iG7Q<8BgKb^#xCD?2`^Vub?)wQ-wE@6F{PVM zK)Y%&aYQuP4#lL3Yaz&O+%<5AVQfHAH_*bfFpYcEtU8(@-y`m*$~LLhq*-vUngcLn z;XWQPOnST}Y$fYle{yt_R)OYH6N%;GT3mL#Qi_*M%wgWZLlP3Py9{rkh!Xv%cF4$; zMDhy5LwnQQQyobv*cyYmqdIdrc@9quU;IiS0V78`ItJAK=wGUJ-ZQSj)#TD&e z2KqnlABwuJ4jS4YVRP5rakQvr)2L+dl3`(0eC18IBM%BkN)}kb-dHbqjxM~9Zbggx zT2M9m#$atqDSX@IK_CJH%M5cdH?GoWfR5et|6A!l^~}Hwo%bX?LrBm8qYFS0;qj-K zpt^}`6fMd=Q=X)Ew)_ht<%JWBl^0Kt`yMrpQ_LYnafo7?1{fHnA$h74dfPC8Ny=zI z1jC|L2o%EH#8e+b5a=@I6>OmT;&v6$T5CUaZM6cn((jMZ^oI~4DQ!(O_D6pWFp-hn8L~T=&?o6@ zwCP9Uk3K*js`f4rg1YA;plcNhRKQ{kjMac-<3GA>H8KArE9^51k3ql3^4*#+ewzJAIDXas+!F zH!Lg@_z2ZrXoTx%?i%7cpel7?k7O7UBe-9j2e9H`6)wY)&)cG;RfC(4(zNI= zG+Y@Xu$e7iB6QMa;||s>++|qka~Ut@U;{RFyA##-6!nq&x~qsAD>K;px*Ie^MfSTf zCU`pnBYitso6rQj^G=wSZiY7QW81<5hV={SQl03w7(UiOO@%j%4tkNy0>hWlM;k^D z0C%}+dLmq}Y2EI2ij(?AJY$Imy^gpf{L@JMhx)N-m|||kHH0W}&)b(q6w^s;rSOc@QgAi`f!;t3ojT} z{vS%OGiU?WXl~=Qrf4A=U)p2zKMkAqD`Zv3j?ro7f5FLb{XqI_KPE%_Ead_T`lcu& ziD=-i4WhAtt7K7LAC<-ci*z@@tWrjlnfZpL&HQ(yPjMUgiM0!8dk8Z}Braex=dc;v g!zRJSktLuQa>&z}BF{rwkMN{ln&By)<0Y2=0r|TGbN~PV literal 0 HcmV?d00001 diff --git a/Code/Steiner/paymentSystemWithInterfaces/bin/Payment.class b/Code/Steiner/paymentSystemWithInterfaces/bin/Payment.class new file mode 100644 index 0000000000000000000000000000000000000000..4f7d30ff5e862be22c2cbab8f4fc4b33b677afe4 GIT binary patch literal 279 zcmXYsL2kk@5Jmrhlavq$lwP1a+66fPhz$s-QUpjK_D*UQqmWc-K;l@ekh9vnOo{7|QAe%MDUU&|;_gy%4eWwMdEHhpD^Vyk}$jj$R##njx9;=x)30?&a%wpmd%<{1S)L3~e*9Lb1E3sPd7r5v0+2d-LCZWZ5?*X6< OALU=sWtW#M>E1uN4m5=T literal 0 HcmV?d00001 diff --git a/Code/Steiner/paymentSystemWithInterfaces/src/App.java b/Code/Steiner/paymentSystemWithInterfaces/src/App.java new file mode 100644 index 0000000..8a2e9cd --- /dev/null +++ b/Code/Steiner/paymentSystemWithInterfaces/src/App.java @@ -0,0 +1,24 @@ +public class App { + + public static void main(String[] args) throws Exception { + + Payment creditCard = new CreditCardPayment("1234-5678-9012-3456", "Max Mustermann"); + + Payment paypal = new PayPalPayment("max@example.com"); + + Payment bankTransfer = new BankTransferPayment("DE89 3704 0044 0532 0130 00"); + + processPayment(creditCard, 49.99); + + processPayment(paypal, 19.99); + + processPayment(bankTransfer, 99.99); + + } + + public static void processPayment(Payment payment, double amount) { + payment.pay(amount); + + } + +} \ No newline at end of file diff --git a/Code/Steiner/paymentSystemWithInterfaces/src/BankTransferPayment.java b/Code/Steiner/paymentSystemWithInterfaces/src/BankTransferPayment.java new file mode 100644 index 0000000..3456c5f --- /dev/null +++ b/Code/Steiner/paymentSystemWithInterfaces/src/BankTransferPayment.java @@ -0,0 +1,12 @@ +public class BankTransferPayment extends Payment implements IPay { + String securityNumber; + + public BankTransferPayment(String securityNumber) { + this.securityNumber = securityNumber; + } + + @Override + public void pay(double amount) { + System.out.println("Bezahlung von " + amount + " CHF mit Banktransfer " + securityNumber); + } +} diff --git a/Code/Steiner/paymentSystemWithInterfaces/src/CreditCardPayment.java b/Code/Steiner/paymentSystemWithInterfaces/src/CreditCardPayment.java new file mode 100644 index 0000000..50d7a4c --- /dev/null +++ b/Code/Steiner/paymentSystemWithInterfaces/src/CreditCardPayment.java @@ -0,0 +1,14 @@ +public class CreditCardPayment extends Payment implements IPay { + String number; + String name; + + public CreditCardPayment(String number, String name) { + this.number = number; + this.name = name; + } + + @Override + public void pay(double amount) { + System.out.println("Bezahlung von " + amount + " CHF mit Kreditkarte " + number + " von " + name); + } +} diff --git a/Code/Steiner/paymentSystemWithInterfaces/src/IPay.java b/Code/Steiner/paymentSystemWithInterfaces/src/IPay.java new file mode 100644 index 0000000..2a37728 --- /dev/null +++ b/Code/Steiner/paymentSystemWithInterfaces/src/IPay.java @@ -0,0 +1,3 @@ +public interface IPay { + public void pay(double amount); +} diff --git a/Code/Steiner/paymentSystemWithInterfaces/src/PayPalPayment.java b/Code/Steiner/paymentSystemWithInterfaces/src/PayPalPayment.java new file mode 100644 index 0000000..ab4dff7 --- /dev/null +++ b/Code/Steiner/paymentSystemWithInterfaces/src/PayPalPayment.java @@ -0,0 +1,12 @@ +public class PayPalPayment extends Payment implements IPay { + String mail; + + public PayPalPayment(String mail) { + this.mail = mail; + } + + @Override + public void pay(double amount) { + System.out.println("Bezahlung von " + amount + " CHF mit Kreditkarte " + mail); + } +} diff --git a/Code/Steiner/paymentSystemWithInterfaces/src/Payment.java b/Code/Steiner/paymentSystemWithInterfaces/src/Payment.java new file mode 100644 index 0000000..8dba32a --- /dev/null +++ b/Code/Steiner/paymentSystemWithInterfaces/src/Payment.java @@ -0,0 +1,3 @@ +public abstract class Payment implements IPay { + public abstract void pay(double amount); +} diff --git a/Code/Steiner/tryCatchTask/.vscode/settings.json b/Code/Steiner/tryCatchTask/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/Code/Steiner/tryCatchTask/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/Code/Steiner/tryCatchTask/README.md b/Code/Steiner/tryCatchTask/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/Steiner/tryCatchTask/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/Steiner/tryCatchTask/bin/App.class b/Code/Steiner/tryCatchTask/bin/App.class new file mode 100644 index 0000000000000000000000000000000000000000..f809a665fca4bc61113dde367441651f6d2c0433 GIT binary patch literal 1926 zcmaJ?TTdHD6#fPbYdf2gm`eglU`Yuz5O8RdUT~5&aiP$dO9LgP>1|jByus{RyW;?V zqfdS88_z@)tx~C#`q+Qd*Get@X3fPGsIqqE%$alh&Sm`PzpsBgJVXKO7McW_A5|(A z5(1ZA$d@u#mi|U=e)WZNwLt5A&-e603T20u1rmi|O{LL{l#Ld&3bYkHU(HpwR#mtp zSIbHuQw&^LUY4O}&PU9IE_snaOOdYfG_xf=U!W`dym;zzQHP$tksn%4;<7+et4NRO z9i4_iyNwQXk{K$wHsu*No!RqLQ@Da|3s)PkEbc~HZQ1C-HR4cVNbQ=k7vvV`RMWMR zTlpkz2uw_dVGvF@OC{y3)0ML=BgYT4vmR9awJ~R*tYoAdx1`)nM;{ASq%Mu6(T9Eu z4g-#1HJZ0^(_pYF#$(w}VnE>Tk+Vm>Gn1Ql7+VlJf$LVoP^~%JCF9>W1-^|T3=5<;l%7>lBsZ9>j_lCcY-Ir4wlRt^fh${bQxyW=mHL^d zOQa$#ea(^$o|osd#w^?sxN(fylxQx{Qzm04fmwL_IASJdX8z=Y{UE~)`f5L?9Rvgc z^qth}T+?i+(~8zvKIJ#&i2RF-TDqIFvU1d+>636G3-{T^^;n*=1S(7;kB6r3J58H? zWaClXP(hVF+J}OTk1@#}kLycJ*}~AWQTfEiG-k*!g^UMj#;~8*D4GdsamztOh)L6I zb8?Gh=4^hMhIQ7lAq};th();kW-Kfn=Ql>XR0@Ob+DxVwgKFq1lRG-%42~Ie9FoUD zpd%g1%B<3*U@b~x1 z{k5`+28uzjS*_&H;;Q2`C@$?*)H&ky4N`le^7Wm4WTGI;vXz^&I90m#~qV`)K>{^^@m&*7IIH4jPo08 zqgg)iL@~k31ck<9WIr(sV|ese787k|SlT3BqQ)6aR)gk?PAo}}{E{Jz0=Jehwp2^R|8{{f_J B&5Qs5 literal 0 HcmV?d00001 diff --git a/Code/Steiner/tryCatchTask/src/App.java b/Code/Steiner/tryCatchTask/src/App.java new file mode 100644 index 0000000..12ad158 --- /dev/null +++ b/Code/Steiner/tryCatchTask/src/App.java @@ -0,0 +1,28 @@ +import java.io.*; + +public class App { + + public static void main(String[] args) { + try { + readFile("test.txt"); + } catch (FileNotFoundException e) { + System.err.println("Error: The file was not found. Please check the file path."); + } catch (IOException e) { + System.err.println("Error: An I/O error occurred while reading the file."); + } catch (Exception e) { + System.err.println("An unexpected error occurred: " + e.getMessage()); + } + } + + private static void readFile(String fileName) throws IOException { + FileReader f = new FileReader(fileName); + try { + int c; + while ((c = f.read()) != -1) { + System.out.print((char) c); + } + } finally { + f.close(); + } + } +} diff --git a/Code/Steiner/tryCatchTask/test.txt b/Code/Steiner/tryCatchTask/test.txt new file mode 100644 index 0000000..885e1ff --- /dev/null +++ b/Code/Steiner/tryCatchTask/test.txt @@ -0,0 +1,22 @@ +🎉 Super! 🎉 + +Du hast es geschafft. + +Herzliche Gratulation! + +🌟 STEINER 🌟 + +Ein Hauch von Magie in der Luft! + +✨ Die Sterne funkeln, während die Gedanken fliegen. ✨ + +🔮 Zufällige Gedanken: + + Kaffeetassen tanzen im Regen. + Ein fliegender Teppich voller Bücher. + Die Farben des Windes singen Lieder. + +🌈 Lass die Kreativität sprudeln! + + Was wäre, wenn die Fische die Wolken fangen könnten? + Ein Abenteuer im Land der Träume wartet auf dich!