From 7663a81750a39c1be0485c2af9cf2d765fc9b78d Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Wed, 8 Jan 2025 14:40:54 +0100 Subject: [PATCH] ahhhhhhhhhhhh --- .../fractionsSteinerTask/bin/Anteil.class | Bin 1120 -> 1269 bytes .../fractionsSteinerTask/bin/AnteilTest.class | Bin 2006 -> 0 bytes .../fractionsSteinerTask/bin/BruchTest.class | Bin 2971 -> 2636 bytes .../fractionsSteinerTask/bin/LegacyTest.class | Bin 0 -> 2974 bytes .../fractionsSteinerTask/src/Anteil.java | 27 ++-- .../fractionsSteinerTask/src/AnteilTest.java | 57 -------- .../fractionsSteinerTask/src/BruchTest.java | 111 ++++++--------- .../fractionsSteinerTask/src/LegacyTest.java | 78 +++++++++++ .../hotelBookKeeping/.vscode/settings.json | 7 + Code/Steiner/hotelBookKeeping/README.md | 18 +++ Code/Steiner/hotelBookKeeping/bin/Euro.class | Bin 0 -> 466 bytes .../hotelBookKeeping/bin/USDollar.class | Bin 0 -> 374 bytes .../hotelBookKeeping/bin/Waehrung.class | Bin 0 -> 500 bytes .../hotelBookKeeping/bin/WaehrungTest.class | Bin 0 -> 1148 bytes Code/Steiner/hotelBookKeeping/bin/Yen.class | Bin 0 -> 463 bytes Code/Steiner/hotelBookKeeping/src/Euro.java | 16 +++ .../hotelBookKeeping/src/USDollar.java | 11 ++ .../hotelBookKeeping/src/Waehrung.java | 17 +++ .../hotelBookKeeping/src/WaehrungTest.java | 25 ++++ Code/Steiner/hotelBookKeeping/src/Yen.java | 16 +++ .../src/main/java/com/example/App.java | 12 +- .../main/java/com/example/CartController.java | 121 ++++++++++++++++ .../java/com/example/CheckOutController.java | 118 ++++++++++++++++ .../java/com/example/LoginController.java | 56 ++++++++ .../java/com/example/RegisterController.java | 87 ++++++++++++ .../main/java/com/example/ShopController.java | 132 ++++++++++++++++++ .../main/java/com/example/cartController.java | 5 - .../java/com/example/checkOutController.java | 45 ------ .../java/com/example/loginController.java | 5 - .../java/com/example/registerController.java | 5 - .../main/java/com/example/shopController.java | 5 - .../src/main/resources/com/example/cart.fxml | 18 +-- .../main/resources/com/example/checkOut.fxml | 88 ++++-------- .../target/classes/com/example/App.class | Bin 1943 -> 2316 bytes .../com/example/CartController$Item.class | Bin 0 -> 1381 bytes .../classes/com/example/CartController.class | Bin 0 -> 2738 bytes .../com/example/CheckOutController.class | Bin 0 -> 4225 bytes .../classes/com/example/LoginController.class | Bin 0 -> 1797 bytes .../com/example/RegisterController.class | Bin 0 -> 3243 bytes .../classes/com/example/ShopController.class | Bin 0 -> 2740 bytes .../target/classes/com/example/cart.fxml | 18 +-- .../classes/com/example/cartController.class | Bin 291 -> 0 bytes .../target/classes/com/example/checkOut.fxml | 88 ++++-------- .../com/example/checkOutController.class | Bin 972 -> 0 bytes .../classes/com/example/loginController.class | Bin 294 -> 0 bytes .../com/example/registerController.class | Bin 303 -> 0 bytes .../classes/com/example/shopController.class | Bin 291 -> 0 bytes .../target/classes/module-info.class | Bin 231 -> 236 bytes .../compile/default-compile/createdFiles.lst | 8 ++ .../compile/default-compile/inputFiles.lst | 7 + 50 files changed, 860 insertions(+), 341 deletions(-) delete mode 100644 Code/Steiner/fractionsSteinerTask/bin/AnteilTest.class create mode 100644 Code/Steiner/fractionsSteinerTask/bin/LegacyTest.class delete mode 100644 Code/Steiner/fractionsSteinerTask/src/AnteilTest.java create mode 100644 Code/Steiner/fractionsSteinerTask/src/LegacyTest.java create mode 100644 Code/Steiner/hotelBookKeeping/.vscode/settings.json create mode 100644 Code/Steiner/hotelBookKeeping/README.md create mode 100644 Code/Steiner/hotelBookKeeping/bin/Euro.class create mode 100644 Code/Steiner/hotelBookKeeping/bin/USDollar.class create mode 100644 Code/Steiner/hotelBookKeeping/bin/Waehrung.class create mode 100644 Code/Steiner/hotelBookKeeping/bin/WaehrungTest.class create mode 100644 Code/Steiner/hotelBookKeeping/bin/Yen.class create mode 100644 Code/Steiner/hotelBookKeeping/src/Euro.java create mode 100644 Code/Steiner/hotelBookKeeping/src/USDollar.java create mode 100644 Code/Steiner/hotelBookKeeping/src/Waehrung.java create mode 100644 Code/Steiner/hotelBookKeeping/src/WaehrungTest.java create mode 100644 Code/Steiner/hotelBookKeeping/src/Yen.java create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CheckOutController.java create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/LoginController.java create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/RegisterController.java create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/ShopController.java delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/cartController.java delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/checkOutController.java delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/loginController.java delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/registerController.java delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/shopController.java create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController$Item.class create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController.class create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CheckOutController.class create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/LoginController.class create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/RegisterController.class create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/ShopController.class delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/cartController.class delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/checkOutController.class delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/loginController.class delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/registerController.class delete mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/shopController.class create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst diff --git a/Code/Steiner/fractionsSteinerTask/bin/Anteil.class b/Code/Steiner/fractionsSteinerTask/bin/Anteil.class index 727851e6ebda4a489c8e367c3981008b59a58f97..4d9c3fa0e56086ccf50cbb42331c026bb99726e6 100644 GIT binary patch delta 764 zcmYLGT~E_c7=BJ$=vK;rF~$ZJyD2h;+ZYVRp(qL@C?OaUBHmRvZZ%yYUFX+@`wgTQ zCSGvijh8AWBTAz8{t7Ss1A3?PZCPTQ^t|WodA{EBBlIh*eE<99YrBm*SUptU-j^}N zkbYu3H42ttR|;#E#Vdxj@GbA^-ZF5K8Gn~h|ZSGcGeOj+` z)6Of1A*n*ehYtF%MeBNY zR6Bv9y+Q9OVms0J2@>Bq}0OszSl=c9OFWCvW2Ov*ur#{+NF00 zC8bY@d?Y>*{Y_eCND3s>jUFge$Iyo{^wSihD3Y0L)LFz3-FY0V7{)y$1H+{=Qys%( z4_7fCgjgrcJOpCNqfERaagAevDhby~D*>@hq@s)_W0d+2in6~GC9-h?=}ztmqVOM? zl2M}fR0`w^#N&@j3tad|=$dh}1G-BZelO||Mv`b=>r(;#)(7gI;g#ToPH87n0ZIG} R(utxVL}7gqhUEaX@(-DDf9?PP delta 588 zcmX9)%Wl(95Itj?IJuaRN1@Q9IOWkMh9qq$uQa^7sgMw;QYF|KVbN4+K#l>?O~0Y? zf?XH<08o&TKtf{6S0Mg@C4_UGYw3FKoH^&r%%9w^tor%y>-X^(cX4x1y;BM%jyX7v z>DZOI?nwtTs0a=}4R-q5{@`^GMgp_mSj}M;u8mWI!j}KaZx8(8v-bL%Q50-Ds9`SN zk(zZz(2MtFrPWe6hXot+f^u5kf8Kr&_J`4W6b3#Sbu0-+6AXz^RL9qJ%3bqlYQn=4y+;F1(37p)yHq1k1R@ z33POskwJ2Yv<$_sGFya<$+m2Wh|MJEb`2F$wCe&1`q-1M-!s$-AYW_FXw$SLhb~s| taKgI9CNx~q^IH}danDNyybo!)7Eme8<-eASIAkbfIZcMB;Cfnl<3BJ&T_XSh diff --git a/Code/Steiner/fractionsSteinerTask/bin/AnteilTest.class b/Code/Steiner/fractionsSteinerTask/bin/AnteilTest.class deleted file mode 100644 index 2e582a2872cb10a22b09bbc44cf5aff184a2568d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/Code/Steiner/fractionsSteinerTask/bin/BruchTest.class b/Code/Steiner/fractionsSteinerTask/bin/BruchTest.class index bba17475d94b8df02b0675852238027a75fbb2df..854a3f68abcab75ca2537ed132ace2846c9afa06 100644 GIT binary patch literal 2636 zcmaJ@TUS#@6#fPRCy7BYii#IJC~Ck9s8kD4D}pF3pcRXPy`6+H9Fm-aCnqTMYHzmo ze$|JrKD9qUA8-}B+STP-ANwErC%U?7znPN=6xy|tJ$v@-+kAV^%=zu_`JW#>LJ#g3 zs1S&p^or?;3$oxF2np0pTGLir&T=wsXH%0h?F&>NwH@0(E>M|h84(EexZ^U4N9k3sx#81>ys4+RBYso~`C3VaT7b3j(VK9tTX)S>Cc8f%S>Y0}FwN zeb06>$(E4_)?lrH_>#1SX9~W|$FL6dOvx=W!}`G3cH7R;(x<(&^2snZ2yAX`Z8f`# zS29*gnmV#6z0AY!omuHb(SXecHVLfN!I#>{umxKMj49bgxNX*>SM8xqrP@v~6TLymgE1UZAy*ZODc`duRM;?{5I`75 zSf0h0bUVJZbCsy9IbooS)eZzvbfQU-V=)}ZQvx+9-6w8P9D#L-mgR870d&W35W*%xK7&gFWUYDxq@#wK3ibdN-I9mymb6i*VA&!w_PWU z7X-{+Tbcp((tP;Sf@kTN2in_rvKV7{Np;s&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Tz(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> diff --git a/Code/Steiner/fractionsSteinerTask/bin/LegacyTest.class b/Code/Steiner/fractionsSteinerTask/bin/LegacyTest.class new file mode 100644 index 0000000000000000000000000000000000000000..077fda7aa9de8c81bec70b782c1aa7fa130257e7 GIT binary patch literal 2974 zcmaJ@OK=ob6g_W#Ju~Tq$%FtwKtR9@0RjXFNdO56|KVq1kbp{OrpYv!PnhWe6aQaC zMNv`lub{ZnDqMuBP-VHa*z1zL8_Nwl70-J;J()2nHn-pXy?gF`_rBM+|DF8#-aYi- zdkr3eaNHa=5@Y>l!Pejth@3Xg8m(y~JKTC`=(L%z1p-^FtYvQ#@HWQ=1bjWYq#1@6 zAsv1M1ZKspta-4Q88Y+z#!%W6h{kgXBRyc`EyoaW>4 zsmOhH-pUSl#RfFg3p6N2(YDg9-TAyR7Pks^7!iat%ogzP$QKi-Fd7h&!nr!;p@~?H zWKy89xnfr*pRU+o2oGSPh6PpG_Kg*6Goxb>9;A1!$iy2RXDiown0RcWGL1}^jIu<> zQanVvVN=>Q?~P55BOxuubZ)DB6I{W&Kwf!WQK4yAOX0Ae~;qD5eC#uzbsa@mAo zAGPchR|VV1+N|G-%9PwfRYWg|!dQ(~4Qt%;RVSfiE!GKWqcX2F>t9tUch>=#LYqA0 z4Lm3&IS_?FOiJ6ObTg~pyjO`mj<`$57TFS!VRNKt=ErTLSQs{k%xskXq8uO5v0ZK# zE|~V9VW!e%UhcO;XGc;TqWGYh&6@cre27IEg(Tqk?$NOq`&i9PF>PC;X=~gv^K7?B zb6hn+SFH4nLUTM0=s1W&Y+>_E(MYp;;j-yq6hR!3<$hGAKRDxogm6TndrZfG46L!K zWXLGO&i==A3`#{!p*Upcjg+ITag2J^~8J)|yNcJVZ%Jw`g+XW3@gtN@-1;#Ho3ys;Or>s%~?c->{!EA|bSZBy)< zF1taoZ@cV9#lGXRn-qJ=W!n||zRPY_>}8kjQ0zxM4hP0s#a}7&4z5qjyaVj>GVdV! zvdlZszAp0;8=GdYya;;IMxkI9G+Yx{KCLn{or;F<1Qy-jlY@+?R+?mRo4x zqHzLqj{b!CE#3(%{sj#aST>1fU;?X@Mc^jZyC%L0lZ{g*S|oTAn_MG*g;9rNR2Frr zEhB$dIRq*kwmJ@FQD;lZH$u_2G839Wx5QlDn3#K~#VTo;*!?|sR(aBV+TOdAg)Eq# z_1JX44ZLasyAKk`YE`xU)mEK8>7YfVN2i}wO}-{VicjKj+0f^g%7CL}id6PZDK)9o z=%!7ezcVPUf-2I{vQ0qQglNN>Jl+|WHeqFRT-h}7%uaOFP&}_@5-0!XSKCx8)pb%` zH;KfQ+ABjxnj%tNFV*#vNGi2#JTIRc;77EO`uS=FF`Lb{l5N+{#yi0OkrSv#9#K4p zMqI=kT*F-2&&MtP>HLZXxPyiG1B-DNON0kY#XKw*%dkRpA|`sVQXJtw$4UMyjG$GV z!&-3xZQ?TDg&{(v6AUl`%a%hK{v*g7vq$9@C=^i_XLOfWlCRB^fg7#D|$iEw-mjo=(~!(r|1WY eeyHfjihiQ#XNrEI=vVlL5yIU4D!#>aH2nwW5wv9h literal 0 HcmV?d00001 diff --git a/Code/Steiner/fractionsSteinerTask/src/Anteil.java b/Code/Steiner/fractionsSteinerTask/src/Anteil.java index e92dd14..e3fe469 100644 --- a/Code/Steiner/fractionsSteinerTask/src/Anteil.java +++ b/Code/Steiner/fractionsSteinerTask/src/Anteil.java @@ -1,33 +1,34 @@ public class Anteil extends Bruch { + public static Bruch verteilt = new Bruch(0, 1); - 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 + if (n == 0) { + throw new IllegalArgumentException("Nenner darf nicht 0 sein."); + } + + Bruch neuerAnteil = new Bruch(z, n); + Bruch neueVerteilung = verteilt.addiere(neuerAnteil); + + if (neueVerteilung.dezimalwert() > 1) { + System.out.println("Fehler: Der Gesamtwert der verteilten Anteile übersteigt 1/1."); + setZaehler(0); setNenner(1); + } else { + verteilt = neueVerteilung; } } - // 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() { + public 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 deleted file mode 100644 index 456c9e2..0000000 --- a/Code/Steiner/fractionsSteinerTask/src/AnteilTest.java +++ /dev/null @@ -1,57 +0,0 @@ -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/BruchTest.java b/Code/Steiner/fractionsSteinerTask/src/BruchTest.java index 9f3fb6c..07aa228 100644 --- a/Code/Steiner/fractionsSteinerTask/src/BruchTest.java +++ b/Code/Steiner/fractionsSteinerTask/src/BruchTest.java @@ -1,78 +1,49 @@ -import java.util.ArrayList; - public class BruchTest { + public static void main(String[] args) { - ArrayList brueche = new ArrayList<>(); + // Bruch-Test + System.out.println("*** Aufgabe Bruch ergänzen"); - // Test 1: Standardkonstruktor - brueche.add(new Bruch()); - System.out.println("Test 1: " + brueche.get(0).bruchToString()); // Erwartet: 0/1 + Bruch bruch1 = new Bruch(1, 2); + Bruch bruch2 = new Bruch(3, 4); + Bruch bruch3 = bruch1.addiere(bruch2); + bruch3.gekuerztausgeben(); + System.out.println(bruch3.dezimalwert()); + Bruch bruch4 = bruch1.subtrahiere(bruch2); + bruch4.gekuerztausgeben(); + System.out.println(bruch4.dezimalwert()); - // Test 2: Konstruktor mit einem Parameter - brueche.add(new Bruch(3)); - System.out.println("Test 2: " + brueche.get(1).bruchToString()); // Erwartet: 3/1 + // 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: y" + 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()); - // 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 + // Anteil-Test - Überprüfung auf Überschreitung + System.out.println(""); + System.out.println("*** Aufgabe Anteil mit Überschreitung testen"); + Anteil anteil3 = new Anteil(100, 1); + System.out.println("Anteil anteil3: " + anteil3.bruchToString()); + System.out.println(""); - // 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 + try { + Anteil neueVerteilung = anteil3; + System.out.println("Neue Verteilung: " + neueVerteilung.bruchToString()); + if (neueVerteilung.dezimalwert() > 1) { + throw new IllegalArgumentException("Die Anteile überschreiten 100%!"); + } + } catch (IllegalArgumentException e) { + System.out.println("Fehler: " + e.getMessage()); + } - // 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 } -} +} \ No newline at end of file diff --git a/Code/Steiner/fractionsSteinerTask/src/LegacyTest.java b/Code/Steiner/fractionsSteinerTask/src/LegacyTest.java new file mode 100644 index 0000000..cba4a8f --- /dev/null +++ b/Code/Steiner/fractionsSteinerTask/src/LegacyTest.java @@ -0,0 +1,78 @@ +import java.util.ArrayList; + +public class LegacyTest { + 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/hotelBookKeeping/.vscode/settings.json b/Code/Steiner/hotelBookKeeping/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/Code/Steiner/hotelBookKeeping/.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/hotelBookKeeping/README.md b/Code/Steiner/hotelBookKeeping/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/Steiner/hotelBookKeeping/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/hotelBookKeeping/bin/Euro.class b/Code/Steiner/hotelBookKeeping/bin/Euro.class new file mode 100644 index 0000000000000000000000000000000000000000..7454771730647b8099b268aa8cf38f8056fdcf90 GIT binary patch literal 466 zcmZ8bO;5r=6r82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E14P5sr#h!Z-szVuUqH z;IoY1Wn`659}uVmzuV>g5EGcB*NQX}m?D8y)=l$E_OO=ASEKZrgdA$oruo6O>+1f9 z&pV>LN9d#)Q7)zXhdv{joqwr_h!XL=t^Df$z+A5@SvxT~{XJ+ygdbZcZ68mE7^3cE mN8&!rb27J+vleiR9d5HW3{QpHsv1&!NrDEh)QgOHkp2s7tK&NW literal 0 HcmV?d00001 diff --git a/Code/Steiner/hotelBookKeeping/bin/Yen.class b/Code/Steiner/hotelBookKeeping/bin/Yen.class new file mode 100644 index 0000000000000000000000000000000000000000..cf0a4e2d3e7599f4ea6f87feed8f0755977c82f5 GIT binary patch literal 463 zcmZ9G%}&BV6ot>w($ZQ*QSfi$N`ZwNmKqj9+(_JLFfIp}K&7_H(E3_NO*C=g1Nczl z87!K(n3;R#p8K8q`St!WpQD3)7X<<9R>dxCfzpjs6P?9l0ehP1nSkgDIHzG8rfvS! zyNy1dPBKzHEUW}@Q4%Qk!dP8q_XDM`Z5G=?HD9JhkLh{MSJa+SnLbkd>|?UP^gn=??;^0faP55q DOZ!02 literal 0 HcmV?d00001 diff --git a/Code/Steiner/hotelBookKeeping/src/Euro.java b/Code/Steiner/hotelBookKeeping/src/Euro.java new file mode 100644 index 0000000..8eb5050 --- /dev/null +++ b/Code/Steiner/hotelBookKeeping/src/Euro.java @@ -0,0 +1,16 @@ +class Euro extends Waehrung { + private static double kurs; + + public Euro(double betrag) { + super(betrag); + } + + public static void setKurs(double kurs) { + Euro.kurs = kurs; + } + + @Override + public double dollarBetrag() { + return getBetrag() * kurs; + } +} \ No newline at end of file diff --git a/Code/Steiner/hotelBookKeeping/src/USDollar.java b/Code/Steiner/hotelBookKeeping/src/USDollar.java new file mode 100644 index 0000000..9f40aec --- /dev/null +++ b/Code/Steiner/hotelBookKeeping/src/USDollar.java @@ -0,0 +1,11 @@ +class USDollar extends Waehrung { + + public USDollar(double betrag) { + super(betrag); + } + + @Override + public double dollarBetrag() { + return this.getBetrag(); + } +} \ No newline at end of file diff --git a/Code/Steiner/hotelBookKeeping/src/Waehrung.java b/Code/Steiner/hotelBookKeeping/src/Waehrung.java new file mode 100644 index 0000000..4b8f029 --- /dev/null +++ b/Code/Steiner/hotelBookKeeping/src/Waehrung.java @@ -0,0 +1,17 @@ +abstract class Waehrung { + private double betrag; + + public Waehrung(double betrag) { + this.betrag = betrag; + } + + public double getBetrag() { + return betrag; + } + + public void setBetrag(double betrag) { + this.betrag = betrag; + } + + public abstract double dollarBetrag(); +} \ No newline at end of file diff --git a/Code/Steiner/hotelBookKeeping/src/WaehrungTest.java b/Code/Steiner/hotelBookKeeping/src/WaehrungTest.java new file mode 100644 index 0000000..759a0c9 --- /dev/null +++ b/Code/Steiner/hotelBookKeeping/src/WaehrungTest.java @@ -0,0 +1,25 @@ +public class WaehrungTest { + + public static void main(String[] args) { + Yen.setKurs(1.0 / 130); + Euro.setKurs(1.0 / 1.05); + Waehrung[] geld = new Waehrung[5]; + geld[0] = new USDollar(2500); + geld[1] = new Yen(200000); + geld[2] = new Euro(600); + geld[3] = new USDollar(20); + geld[4] = new Euro(500); + double dollarGeldBetrag = berechneDollarGeldBetrag(geld); + System.out.println(dollarGeldBetrag); + } + + public static double berechneDollarGeldBetrag(Waehrung[] geld) { + double summeInDollar = 0; + for (Waehrung waehrung : geld) { + summeInDollar += waehrung.dollarBetrag(); + } + return summeInDollar; + + } + +} \ No newline at end of file diff --git a/Code/Steiner/hotelBookKeeping/src/Yen.java b/Code/Steiner/hotelBookKeeping/src/Yen.java new file mode 100644 index 0000000..72fbc38 --- /dev/null +++ b/Code/Steiner/hotelBookKeeping/src/Yen.java @@ -0,0 +1,16 @@ +class Yen extends Waehrung { + private static double kurs; + + public Yen(double betrag) { + super(betrag); + } + + public static void setKurs(double kurs) { + Yen.kurs = kurs; + } + + @Override + public double dollarBetrag() { + return getBetrag() * kurs; + } +} \ No newline at end of file diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java index 0a8c8fe..3eb8916 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java @@ -17,8 +17,16 @@ public class App extends Application { @Override public void start(Stage stage) throws IOException { - scene = new Scene(loadFXML("shop"), 640, 480); + // Load FXML and create the scene + scene = new Scene(loadFXML("shop")); + + // Apply the CSS stylesheet + scene.getStylesheets().add(getClass().getResource("styles.css").toExternalForm()); + + // Set the stage properties stage.setScene(scene); + stage.setTitle("Fantasy Brigade Bookshop"); + stage.setFullScreen(true); // Make the application fullscreen stage.show(); } @@ -35,4 +43,4 @@ public class App extends Application { launch(); } -} \ No newline at end of file +} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java new file mode 100644 index 0000000..1a2d6c0 --- /dev/null +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java @@ -0,0 +1,121 @@ +package com.example; + +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TableColumn; +import javafx.scene.control.TableView; +import javafx.scene.control.cell.PropertyValueFactory; + +public class CartController { + + @FXML + private Button cartBtn; + + @FXML + private Button loginBtn; + + @FXML + private Button btnCheckOut; + + @FXML + private TableView cartContent; + + @FXML + private TableColumn nameColumn; + + @FXML + private TableColumn descriptionColumn; + + @FXML + private TableColumn quantityColumn; + + @FXML + private TableColumn priceColumn; + + @FXML + private Label cartTitle; + + @FXML + private Label mainTitle; + + // Initialize method to set up the TableView + @FXML + public void initialize() { + nameColumn.setCellValueFactory(new PropertyValueFactory<>("name")); + descriptionColumn.setCellValueFactory(new PropertyValueFactory<>("description")); + quantityColumn.setCellValueFactory(new PropertyValueFactory<>("quantity")); + priceColumn.setCellValueFactory(new PropertyValueFactory<>("price")); + + // Populate the table with some sample data (replace with actual logic later) + cartContent.getItems().addAll( + new Item("Book A", "A fascinating fantasy novel.", 1, 12.99), + new Item("Book B", "A thrilling sequel.", 2, 10.50)); + } + + @FXML + private void handleCartButton(ActionEvent event) { + System.out.println("Cart button clicked!"); + // Add logic to navigate to the cart view or perform related actions + } + + @FXML + private void handleLoginButton(ActionEvent event) { + System.out.println("Login button clicked!"); + // Add logic to open the login page or dialog + } + + @FXML + private void handleCheckOutButton(ActionEvent event) { + System.out.println("Checkout button clicked!"); + // Add logic to proceed to checkout + } + + // Inner class to represent items in the cart + public static class Item { + private String name; + private String description; + private int quantity; + private double price; + + public Item(String name, String description, int quantity, double price) { + this.name = name; + this.description = description; + this.quantity = quantity; + this.price = price; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + } +} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CheckOutController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CheckOutController.java new file mode 100644 index 0000000..98eba55 --- /dev/null +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CheckOutController.java @@ -0,0 +1,118 @@ +package com.example; + +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.control.*; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; + +public class CheckOutController { + + @FXML + private Label mainTitle; + + @FXML + private Button cartBtn; + + @FXML + private Button loginBtn; + + @FXML + private Label checkoutHeader; + + @FXML + private Label paymentTitle; + + @FXML + private Label paymentSubtitle; + + @FXML + private Button creditCard; + + @FXML + private Button bill; + + @FXML + private Button paypal; + + @FXML + private TextField fullNameField; + + @FXML + private TextField addressField; + + @FXML + private TextField cityField; + + @FXML + private TextField zipField; + + @FXML + private ComboBox countryComboBox; + + @FXML + private TextField cardNumberField; + + @FXML + private TextField cardHolderNameField; + + @FXML + private TextField expiryDateField; + + @FXML + private PasswordField cvvField; + + @FXML + private Button submitButton; + + public void initialize() { + // Initialize the country combo box with some values + countryComboBox.getItems().addAll("United States", "Canada", "United Kingdom", "Germany", "Australia"); + countryComboBox.getSelectionModel().selectFirst(); + } + + @FXML + private void handleCartButton(ActionEvent event) { + System.out.println("Cart button clicked."); + // Logic to navigate to the cart page + } + + @FXML + private void handleLoginButton(ActionEvent event) { + System.out.println("Login button clicked."); + // Logic to navigate to the login page + } + + @FXML + private void handlePaymentMethod(ActionEvent event) { + Button clickedButton = (Button) event.getSource(); + System.out.println("Selected payment method: " + clickedButton.getId()); + // Highlight the selected payment method or save the selection + } + + @FXML + private void handleSubmit(ActionEvent event) { + System.out.println("Submit button clicked."); + + String fullName = fullNameField.getText(); + String address = addressField.getText(); + String city = cityField.getText(); + String zip = zipField.getText(); + String country = countryComboBox.getValue(); + String cardNumber = cardNumberField.getText(); + String cardHolderName = cardHolderNameField.getText(); + String expiryDate = expiryDateField.getText(); + String cvv = cvvField.getText(); + + // Validate the input fields + if (fullName.isEmpty() || address.isEmpty() || city.isEmpty() || zip.isEmpty() || cardNumber.isEmpty() + || cardHolderName.isEmpty() || expiryDate.isEmpty() || cvv.isEmpty()) { + System.out.println("Please fill out all fields."); + } else { + System.out.println("Form submitted successfully."); + System.out.printf("Billing Info: %s, %s, %s, %s, %s\n", fullName, address, city, zip, country); + System.out.printf("Credit Card Info: %s, %s, %s, CVV: %s\n", cardNumber, cardHolderName, expiryDate, cvv); + // Process the payment here + } + } +} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/LoginController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/LoginController.java new file mode 100644 index 0000000..f37b480 --- /dev/null +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/LoginController.java @@ -0,0 +1,56 @@ +package com.example; + +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.PasswordField; +import javafx.scene.control.TextField; +import javafx.scene.input.MouseEvent; + +public class LoginController { + + @FXML + private Label mainTitle; + + @FXML + private Button cartBtn; + + @FXML + private Button loginBtn; + + @FXML + private TextField usernameInput; + + @FXML + private PasswordField passwordInput; + + @FXML + private Button loginButton; + + @FXML + private Label footerCopyText; + + @FXML + private void handleCartButtonClick(MouseEvent event) { + System.out.println("Cart button clicked."); + // Logic to navigate to the cart page + } + + @FXML + private void handleLoginButtonClick(MouseEvent event) { + String username = usernameInput.getText(); + String password = passwordInput.getText(); + + if (validateCredentials(username, password)) { + System.out.println("Login successful!"); + // Navigate to the main page or user dashboard + } else { + System.out.println("Invalid username or password."); + } + } + + private boolean validateCredentials(String username, String password) { + // Replace this with actual authentication logic + return "user".equals(username) && "password".equals(password); + } +} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/RegisterController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/RegisterController.java new file mode 100644 index 0000000..dbfe841 --- /dev/null +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/RegisterController.java @@ -0,0 +1,87 @@ +package com.example; + +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.input.MouseEvent; + +public class RegisterController { + + @FXML + private Label mainTitle; + + @FXML + private Button cartBtn; + + @FXML + private Button loginBtn; + + @FXML + private TextField nameInput; + + @FXML + private TextField surnameInput; + + @FXML + private TextField emailInput; + + @FXML + private TextField phoneInput; + + @FXML + private TextField streetInput; + + @FXML + private TextField cityInput; + + @FXML + private TextField cityCodeInput; + + @FXML + private Button createAccountButton; + + @FXML + private Label footerCopyText; + + @FXML + private void handleCartButtonClick(MouseEvent event) { + System.out.println("Cart button clicked."); + // Logic to navigate to the cart page + } + + @FXML + private void handleLoginButtonClick(MouseEvent event) { + System.out.println("Login button clicked."); + // Logic to navigate to the login page + } + + @FXML + private void handleCreateAccountButtonClick(MouseEvent event) { + String name = nameInput.getText(); + String surname = surnameInput.getText(); + String email = emailInput.getText(); + String phone = phoneInput.getText(); + String street = streetInput.getText(); + String city = cityInput.getText(); + String cityCode = cityCodeInput.getText(); + + if (validateForm(name, surname, email, phone, street, city, cityCode)) { + System.out.println("Account created successfully!"); + System.out.println("Name: " + name + " " + surname); + System.out.println("Email: " + email); + System.out.println("Phone: " + phone); + System.out.println("Address: " + street + ", " + city + " - " + cityCode); + // Add logic to save user data or navigate to a new page + } else { + System.out.println("Please fill in all the fields correctly."); + } + } + + private boolean validateForm(String name, String surname, String email, String phone, String street, String city, + String cityCode) { + // Basic validation to ensure no fields are empty + return !(name.isEmpty() || surname.isEmpty() || email.isEmpty() || phone.isEmpty() || street.isEmpty() + || city.isEmpty() || cityCode.isEmpty()); + } +} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/ShopController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/ShopController.java new file mode 100644 index 0000000..1a0dfe2 --- /dev/null +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/ShopController.java @@ -0,0 +1,132 @@ +package com.example; + +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextArea; + +public class ShopController { + + @FXML + private Button cartBtn; + + @FXML + private Button loginBtn; + + @FXML + private Button cardBtn1; + + @FXML + private Button cardBtn2; + + @FXML + private Button cardBtn3; + + @FXML + private Button cardBtn4; + + @FXML + private Button cardBtn5; + + @FXML + private Button cardBtn6; + + @FXML + private Button cardBtn7; + + @FXML + private Button cardBtn8; + + @FXML + private Label mainTitle; + + @FXML + private TextArea cardText1; + + @FXML + private TextArea cardText2; + + @FXML + private TextArea cardText3; + + @FXML + private TextArea cardText4; + + @FXML + private TextArea cardText5; + + @FXML + private TextArea cardText6; + + @FXML + private TextArea cardText7; + + @FXML + private TextArea cardText8; + + @FXML + public void initialize() { + // Initialization logic can go here. + System.out.println("ShopController initialized."); + } + + @FXML + private void handleCartButton() { + System.out.println("Cart button clicked!"); + // Logic for displaying the cart. + } + + @FXML + private void handleLoginButton() { + System.out.println("Login button clicked!"); + // Logic for handling login. + } + + @FXML + private void handleAddToCartButton1() { + System.out.println("Added 'Lord of the Rings' to cart!"); + // Logic for adding the first book to the cart. + } + + @FXML + private void handleAddToCartButton2() { + System.out.println("Added 'The Wheel of Time' to cart!"); + // Logic for adding the second book to the cart. + } + + @FXML + private void handleAddToCartButton3() { + System.out.println("Added 'The Chronicles of Narnia' to cart!"); + // Logic for adding the third book to the cart. + } + + @FXML + private void handleAddToCartButton4() { + System.out.println("Added 'The Earthsea Cycle' to cart!"); + // Logic for adding the fourth book to the cart. + } + + @FXML + private void handleAddToCartButton5() { + System.out.println("Added 'The First Law Trilogy' to cart!"); + // Logic for adding the fifth book to the cart. + } + + @FXML + private void handleAddToCartButton6() { + System.out.println("Added 'The Kingkiller Chronicle' to cart!"); + // Logic for adding the sixth book to the cart. + } + + @FXML + private void handleAddToCartButton7() { + System.out.println("Added 'The Mistborn Series' to cart!"); + // Logic for adding the seventh book to the cart. + } + + @FXML + private void handleAddToCartButton8() { + System.out.println("Added 'The Stormlight Archive' to cart!"); + // Logic for adding the eighth book to the cart. + } +} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/cartController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/cartController.java deleted file mode 100644 index 9e7ba91..0000000 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/cartController.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.example; - -public class cartController { - -} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/checkOutController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/checkOutController.java deleted file mode 100644 index f6863b0..0000000 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/checkOutController.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.example; - -import javafx.fxml.FXML; -import javafx.scene.control.Button; -import javafx.scene.control.ComboBox; -import javafx.scene.control.PasswordField; -import javafx.scene.control.TextField; -import javafx.scene.layout.GridPane; - -public class checkOutController { - - @FXML - private TextField addressField; - - @FXML - private TextField addressField1; - - @FXML - private GridPane billingForm; - - @FXML - private TextField cardHolderNameField; - - @FXML - private TextField cardNumberField; - - @FXML - private TextField cityField; - - @FXML - private ComboBox countryComboBox; - - @FXML - private PasswordField cvvField; - - @FXML - private TextField expiryDateField; - - @FXML - private Button submitButton; - - @FXML - private TextField zipField; - -} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/loginController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/loginController.java deleted file mode 100644 index e278e2a..0000000 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/loginController.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.example; - -public class loginController { - -} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/registerController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/registerController.java deleted file mode 100644 index 8fc8916..0000000 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/registerController.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.example; - -public class registerController { - -} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/shopController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/shopController.java deleted file mode 100644 index e21935c..0000000 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/shopController.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.example; - -public class shopController { - -} diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/resources/com/example/cart.fxml b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/resources/com/example/cart.fxml index 7049760..19cdf0d 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/resources/com/example/cart.fxml +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/resources/com/example/cart.fxml @@ -13,7 +13,7 @@ - + @@ -48,13 +48,13 @@