From f3b770e97274a55530ef063244e5f11f9169603e Mon Sep 17 00:00:00 2001 From: Sage The DM Date: Thu, 24 Oct 2024 11:05:15 +0200 Subject: [PATCH] Full commit --- .../.vscode/settings.json | 7 +++ .../praxis_repetition-23-10-24/README.md | 18 +++++++ .../praxis_repetition-23-10-24/bin/App.class | Bin 0 -> 2325 bytes .../bin/Customer.class | Bin 0 -> 1408 bytes .../praxis_repetition-23-10-24/src/App.java | 39 ++++++++++++++ .../src/Customer.java | 50 ++++++++++++++++++ .../static_theorie/.vscode/settings.json | 7 +++ Code/Steiner/static_theorie/README.md | 18 +++++++ Code/Steiner/static_theorie/bin/App.class | Bin 0 -> 777 bytes Code/Steiner/static_theorie/bin/Person.class | Bin 0 -> 652 bytes Code/Steiner/static_theorie/src/App.class | Bin 0 -> 635 bytes Code/Steiner/static_theorie/src/App.java | 11 ++++ Code/Steiner/static_theorie/src/Person.class | Bin 0 -> 565 bytes Code/Steiner/static_theorie/src/Person.java | 13 +++++ 14 files changed, 163 insertions(+) create mode 100644 Code/Steiner/praxis_repetition-23-10-24/.vscode/settings.json create mode 100644 Code/Steiner/praxis_repetition-23-10-24/README.md create mode 100644 Code/Steiner/praxis_repetition-23-10-24/bin/App.class create mode 100644 Code/Steiner/praxis_repetition-23-10-24/bin/Customer.class create mode 100644 Code/Steiner/praxis_repetition-23-10-24/src/App.java create mode 100644 Code/Steiner/praxis_repetition-23-10-24/src/Customer.java create mode 100644 Code/Steiner/static_theorie/.vscode/settings.json create mode 100644 Code/Steiner/static_theorie/README.md create mode 100644 Code/Steiner/static_theorie/bin/App.class create mode 100644 Code/Steiner/static_theorie/bin/Person.class create mode 100644 Code/Steiner/static_theorie/src/App.class create mode 100644 Code/Steiner/static_theorie/src/App.java create mode 100644 Code/Steiner/static_theorie/src/Person.class create mode 100644 Code/Steiner/static_theorie/src/Person.java diff --git a/Code/Steiner/praxis_repetition-23-10-24/.vscode/settings.json b/Code/Steiner/praxis_repetition-23-10-24/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/Code/Steiner/praxis_repetition-23-10-24/.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/praxis_repetition-23-10-24/README.md b/Code/Steiner/praxis_repetition-23-10-24/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/Steiner/praxis_repetition-23-10-24/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/praxis_repetition-23-10-24/bin/App.class b/Code/Steiner/praxis_repetition-23-10-24/bin/App.class new file mode 100644 index 0000000000000000000000000000000000000000..47fd76a6179ccae81b2af36f13d920ba62df6105 GIT binary patch literal 2325 zcmbVNT~`xV6y293WC$bZ@Fi3(T8_YI?pdh~Sq?nQsTF57G@PQ#1Jm&} z3<;!H|N7mwrKe$p5t_dA3L3@)`WvS2zi_>3Vex7P0^>R+@RqfELA=f^C69AR!6jOa@R(3U9V4!l~I#R>MIMGE7 zmpc-@cKwEeozXFiJS*K`!Gac}HM1^R;u9SlLd8t4#_gdll@{o$#6>CyWZK+24i?i` z6wq2A85D3$Nq=47@*9Iv(M%z*ybfl}oNuF@q;outUoa zOedgHH@j5jc(yagw=(z?>uHoJc37OF=sG@A6-|ddW3yRPN(4WR&yOY(4xy6lsg7s( zf|AubBpc3k1uoz#9bdP+W5rYuQ^yu6(S)dpf5V=6s(~VpmE2lQRx*TwdR?S9y<7CQi)2qm39#ec?JM*e2%=NzO27cg~ja3=! zxK%%cI@~l!Zo1u5mb2&X%7y4kiey?gD}n3nEBzV*KXj@Tdq)9zZ&hvSPnTSGx7jEj z*QsOY$cyXy4cW!LvkjwLx!9>e9Ae3|?Xnff;$Saq4eBCj&FrnL$O-{{#c`y!#2N9G z?0W(ikLBAfgEU?Woc(WCekY=IF~#Xhu+M>BTKq)tKh4zwpMuZS>?>%$(C9%Xb^;Ij zY3q>#pC`EL!vF@kqh9_V$uMZaIB6KhurYdw)1`c5oH4S-d1KnR#J$zI$T*WfL~f41 zHqhBHP?Et@7>0%{0dic;5$tV3DFWFDgnL&)Iu|h?^3LKEeHKE>{KCYfUXoObeiOf; zusL_-6|UY&jwfdiaAQ1~KftZ=I7LM0{%%aS-@*0~x#8T;3e3VZt=97!Bu?igElXd|H!sJd9 za2%ryui!_cSHrNBhU7MwI!9jJjxoR;0w_X5sXy>!Gr{~e%bP0AFU#%xl*+(l7&MY` zC=QxYU&uIAlN3~MOwQ)#4)D#77$9GxN}4~RUzyu6<3!jSqhWETDAait?E*_SjWf6u xf<#hH#vlq>l`A5l%GHA%0xSL$QX#0%_W{9n7{8Ych% literal 0 HcmV?d00001 diff --git a/Code/Steiner/praxis_repetition-23-10-24/bin/Customer.class b/Code/Steiner/praxis_repetition-23-10-24/bin/Customer.class new file mode 100644 index 0000000000000000000000000000000000000000..390ca7d08d1b56c3d22279afa138de89b6aca54e GIT binary patch literal 1408 zcma))-Ez`U5Xb)q0x2Oah_q6yS`;k-EUmZI-gKr{_%TCe#@+=QF%^=U4}BKjp%*&S z>WmjYfDh%kn}m--nDHiO&t`Z3zq7l4{{H$6;02z^NC>PP`L1V=3`d3}kU!Ty>#d<~ z4O*{z=SJTXkl)*mrH>4OLVNnR<2j}^IH2FIAN`hm*Knxdh3>jvZ0AfM{oJ%n?@(Z; zwwSu;(YgZCk$q+;NMcQef}B9IrgbwAxTRtRX|`^w$RI6{Ynztw${+O%=S1%f1344@~R7xlR?_#XT8YHyRYSK*fDLpr;z2e0@kd>$6V{ zdw8Io(!;nd0;?TQ?|*!$Uqp1u!0?X84KCKS#jfy^AFD|5lNEO+`i4?84{jls?1V$% z+`0;RoEy1mY83M}7?(^XLn}+ZHOZksZ(Ji^Z(gJDJxD0hw?HL9Q&=m^Jz)VS($xF&if)&SA zrYhx$N_nDECIVKe1bL!FLJ#pMl55e)C@IpYej_6>Q@I%Mt6@M?S>OqFqU1x0PA~_z zqdM(`5_n70-p!!GMi@0=O9zc-;aV(+HV?8D3(|-O(dI$6Nv^U4geT7+%~+89JV-Sb y?k-cCU_WuFXyUWu6 literal 0 HcmV?d00001 diff --git a/Code/Steiner/praxis_repetition-23-10-24/src/App.java b/Code/Steiner/praxis_repetition-23-10-24/src/App.java new file mode 100644 index 0000000..e77dd32 --- /dev/null +++ b/Code/Steiner/praxis_repetition-23-10-24/src/App.java @@ -0,0 +1,39 @@ +public class App { + public static void main(String[] args) { + // Customer 1 + Customer customer1 = createCustomer("Hans", "Müller", "user1", "password123"); + logIn(customer1, "user1", "password123"); + + // Customer 2 + Customer customer2 = createCustomer("Jack", "Stone", "user2", "password456"); + logIn(customer2, "user2", "password456"); + + // Retrieve names and print them + printCustomerNames(customer1); + printCustomerNames(customer2); + } + + private static Customer createCustomer(String firstName, String lastName, String user, String password) { + Customer customer = new Customer(user, password); + customer.setForname(firstName); + customer.setSurname(lastName); + return customer; + } + + private static void printCustomerNames(Customer customer) { + String[] names = retrieveNames(customer); + System.out.println("Customer: " + names[0] + " " + names[1]); + } + + private static String[] retrieveNames(Customer customer) { + return new String[] { customer.getForname(), customer.getSurname() }; + } + + private static void logIn(Customer customer, String user, String password) { + if (customer.login(user, password)) { + System.out.println("Logged in successfully."); + } else { + System.out.println("Login failed."); + } + } +} diff --git a/Code/Steiner/praxis_repetition-23-10-24/src/Customer.java b/Code/Steiner/praxis_repetition-23-10-24/src/Customer.java new file mode 100644 index 0000000..1eccf7c --- /dev/null +++ b/Code/Steiner/praxis_repetition-23-10-24/src/Customer.java @@ -0,0 +1,50 @@ +public class Customer { + private String forname; + private String surname; + private String user; + private String password; + + // Constructor + public Customer(String user, String password) { + this.user = user; + this.password = password; + } + + // Login method: use .equals() for string comparison + public boolean login(String user, String pass) { + return this.user.equals(user) && this.password.equals(pass); + } + + // #region Setter and Getters + public String getForname() { + return forname; + } + + public void setForname(String forname) { + this.forname = forname; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String surname) { + this.surname = surname; + } + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/Code/Steiner/static_theorie/.vscode/settings.json b/Code/Steiner/static_theorie/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/Code/Steiner/static_theorie/.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/static_theorie/README.md b/Code/Steiner/static_theorie/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/Steiner/static_theorie/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/static_theorie/bin/App.class b/Code/Steiner/static_theorie/bin/App.class new file mode 100644 index 0000000000000000000000000000000000000000..98af84fe8d855afe4305a43a6343c631a5811dbc GIT binary patch literal 777 zcmZuu+iuf96r6RPI5DOPxfBu#v|Jr74J~)lRv=0Rk_(Z7iV#nmuu5Gewq-jA#0$R! zNVEcp58$H^vq>SU)R*0J_MDwLGw1i8AHM*sVcmiuF!MNyESLhtUHM)%2Quh4Uv_s@ zFBQnH`hlOWv&n623z$#Bcgn^L@(wb{3KTp)P%lQqu8LpD?m!8Yys#$++cNfbe(-3f zJANXN@krGo%uxD)z?}Qmn^Jbt*bn+GO=Ca(&{I+Bhe2YYBv77q{jcOv!JLIEXKbrD z2?GZwaZ14Ig`*%gGiU=e5F2I(jXW zJTBt0g-eG_>U>O6HFR(VE)5Dt^s72S_QPhIYEo)aa@fi~+Wbtz0UOt`WZ{Ou>{Qa0 zOm`eKag!j4_QiBJ8XGoNaNEMIf9elII=F+o6dP%l!NDKBAQ|^*bomHl1&nA}Am>f& z;u?%-gXdLUj$WjkALFY_;P?JQZr<0e9GaVU$ z7iDE?bS{wRf?BGUTF{+dG|o&Or>BPk|0qi0G&WBJ?r=0`^V96DZbEP=L>&!5dm5+u zMY&w){FPcH6;KwbWUlhq=IdhPXbsaF{?9X-2XL_+qJzLkPXNoX6T*W}O7ku*C}p}b zMOBgt>ZW|HiY9L2wuf6AHfNs-qn9BD*rV*Mq~qR-G|nc+bY|#JtL34OyMka~N~DPk$x6i*R7ShM|Kc literal 0 HcmV?d00001 diff --git a/Code/Steiner/static_theorie/src/App.class b/Code/Steiner/static_theorie/src/App.class new file mode 100644 index 0000000000000000000000000000000000000000..0b2ff058f67ce289c04dc81a20787525bbe4555c GIT binary patch literal 635 zcmZuvYflqF6g|`KcG`7?0V*E5M6I{~HHoLP%zxkKc zM2IH-0DqM63_cnXH`%$5x#ygFXXeMxuipXO!`%R5n606VIf*k>%m;KAsyOTHxf;%6 zvGQ=^18ac*OSll=A}&c>mRJ_3+)qqm9|)A=#INj9(*=9QQj<%>j5}$O_4G#Kz|}{?;i`j$7)KPM zffXvZb(W{(^xN9%%xzs^@KhPYx~qsJu7y}dQ{sAv8@MTPE5vQwVXx#9h(?WUb@z48 z3QUbs|N0S-y|gft5D?D<>hb?4@NKc9@?*4}_qo*r>ZJwA>%VbH+H7-d%i*;etO<;b zL^qXv!}8o6l^3r!*8jG29K@D}j-vmkY#WO>$y;<^2|Rv8TqhVU&9CTkpDlr`}Yd=Xdr5()*t8sRMyx^?!QnlH{Y{hUDC-=gYIG*OK9d z+v+l6sOZY=3#6)XS!Tc8{Z+D?K@_&-u@_fm8#3$%{!ZN5!8i&6aCpWX*vOh#aj=Rt z0lT6iS&{0&?VDJ4uz?)S{g4GFhR)Ahx3aB9Le0m%l07;JA|{GIb9h0$!5I}Nm2Qud z77~roFgJA<7j=CsbD0*GtnsEZe#J(|h$#pf&k-m1cgPBj_jK(IqL$ZQkg9DH2GI5E zXXsDN2}}}8Fo*_pD%eOKgt5B@nfV$ Ox}}q_Ml3R^q4W(CzGH6y literal 0 HcmV?d00001 diff --git a/Code/Steiner/static_theorie/src/Person.java b/Code/Steiner/static_theorie/src/Person.java new file mode 100644 index 0000000..b8e2bcb --- /dev/null +++ b/Code/Steiner/static_theorie/src/Person.java @@ -0,0 +1,13 @@ +public class Person { + static int counter = 0; + String name = ""; + + public Person(String n) { + this.name = n; + counter++; + } + + public static void tuWas() { + System.out.println(" tue etwas"); + } +}