From 67ab03f9163fce2ac41940c1bba7534698d39ab0 Mon Sep 17 00:00:00 2001 From: Vieira Date: Tue, 8 Feb 2022 15:59:04 +0100 Subject: [PATCH] TP4 --- APL2.1/TP3/Question.class | Bin 878 -> 1286 bytes APL2.1/TP3/Question.java | 49 +++++++++++------- APL2.1/TP3/Rose.java | 0 APL2.1/TP4/Date/Date.class | Bin 0 -> 1521 bytes APL2.1/TP4/Date/Date.java | 44 ++++++++++++++++ APL2.1/TP4/Date/Testdate.class | Bin 0 -> 923 bytes APL2.1/TP4/Date/Testdate.java | 8 +++ APL2.1/TP4/Lendemain/Date.class | Bin 0 -> 1772 bytes APL2.1/TP4/Lendemain/Date.java | 62 +++++++++++++++++++++++ APL2.1/TP4/Lendemain/Lendemain.class | Bin 0 -> 979 bytes APL2.1/TP4/Lendemain/Lendemain.java | 8 +++ APL2.1/TP4/Progression/Compteur.class | Bin 0 -> 513 bytes APL2.1/TP4/Progression/Compteur.java | 18 +++++++ APL2.1/TP4/Progression/Progression.class | Bin 0 -> 535 bytes APL2.1/TP4/Progression/Progression.java | 9 ++++ 15 files changed, 181 insertions(+), 17 deletions(-) create mode 100644 APL2.1/TP3/Rose.java create mode 100644 APL2.1/TP4/Date/Date.class create mode 100644 APL2.1/TP4/Date/Date.java create mode 100644 APL2.1/TP4/Date/Testdate.class create mode 100644 APL2.1/TP4/Date/Testdate.java create mode 100644 APL2.1/TP4/Lendemain/Date.class create mode 100644 APL2.1/TP4/Lendemain/Date.java create mode 100644 APL2.1/TP4/Lendemain/Lendemain.class create mode 100644 APL2.1/TP4/Lendemain/Lendemain.java create mode 100644 APL2.1/TP4/Progression/Compteur.class create mode 100644 APL2.1/TP4/Progression/Compteur.java create mode 100644 APL2.1/TP4/Progression/Progression.class create mode 100644 APL2.1/TP4/Progression/Progression.java diff --git a/APL2.1/TP3/Question.class b/APL2.1/TP3/Question.class index 43779248d2023e2ec6430ef8bae008f27ff506ab..6c58ed276df751cee1d9aacfd1394419d8c553b1 100644 GI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~n|M_jo!o?8>Si}U#IchC9mIq%$G*4FnwU%mn>+;N#=*5<5>!K^mt zY|gu+nbXMyn~N^azvPn5WtUM+pLbYr8DmlBzQdA3p!vQwS8PI?tM5N;my1j*ay!vs z^eWsx>g;ZZ>ucTUMcZSUN^e6I=ZaK3u5n$F*R(J?io^Te&Q>jYy>}3M+~8*Kr&_Lh z6j|}O#cf5ZzPGC|>zj>+N0n8D^YEa(A9pmI8J2k-Nv{V_ciPY5Uc)H#J{pgvCg*D> zcbjonH`JFZb?%(PMey)d!5Va^ndTRWm4= zeKO4)fIgdSgtRz4zH&dv&j~_xb+o>o)+`a3_HTdg6$q*O*hr z^d)c_XAHZd ze9Hkg=W4aAcxmmaT%e?ANx92#rlvhNFZJW1USU+x($y7#!BqXN z1hPg%h97}@0R{CG^_c)t8#m02+!W|PkXLlKyfw8yplZvrGOxYzwvAg{hdIw%+uRUv za;~e&(P?{c-#9*`I3E}gM#wB8qmbD}-*X-5BYa&=Xr^u9X@b97^ljgwox+2&cPtVSQj;z&yzltO8<0n)jOEVmIJ8*#vFdK2s09AS#mn2CMO6e(=~KuBxS@-gF<5Bia`GGvVb z@7YbrzrZP8IM`_nNk*NtT^v<6GU&k={W$tC#moZE;354}44{BPJjXe_pnr)pYrr_V zhqH*-hzlE?)i1DTCd3@2)a2s-iAx0Fl68E%-7a5GHQ2)k!4@~JU3G50CR)B GP5lOmg*b8m literal 0 HcmV?d00001 diff --git a/APL2.1/TP4/Date/Date.java b/APL2.1/TP4/Date/Date.java new file mode 100644 index 0000000..2423796 --- /dev/null +++ b/APL2.1/TP4/Date/Date.java @@ -0,0 +1,44 @@ + +public class Date { + + private int year; + private int month; + private int day; + + public Date(int d, int m, int y) { + this.year = y; + this.month = m; + this.day = d; + } + public int Day() { + return this.day; + } + public int Month() { + return this.month; + } + public int Year() { + return this.year; + } + public String toString() { + int i; + String sday = Integer.toString(this.day); + String smonth = Integer.toString(this.month); + String syear = Integer.toString(this.year); + if (sday.length() < 2) { + for (i = 0; i<2-sday.length(); i++) { + sday = "0"+sday; + } + } + if (smonth.length() < 2) { + for (i = 0; i<2-smonth.length(); i++) { + smonth = "0"+smonth; + } + } + if (syear.length() < 4) { + for (i = 0; i<4-syear.length(); i++) { + syear = "0"+syear; + } + } + return syear+"-"+smonth+"-"+sday; + } +} \ No newline at end of file diff --git a/APL2.1/TP4/Date/Testdate.class b/APL2.1/TP4/Date/Testdate.class new file mode 100644 index 0000000000000000000000000000000000000000..578e2858f660adb03804f7468988162180bb0515 GIT binary patch literal 923 zcmaJkAOIIqCN^5IBs8U^8Eq?qk5#tXrjU=EZkQ(E!0VeIjGDCKUCcKHS zp+9U=6Cc0_@iB~dSPV2YZnAqn=G=SFJv+btT>b>`9M2r2uwooku(^R9NBaS@-UT%p{cexfv2Ajqb9P03f62{-Lv71H#dkopvO6gDseAp2B zOm)Ld5_eO$mqro$HtwhK04_u7Uq7mtO@H6+iH@cf+*++>ILw_j$DtMj+DeTGk&ifg zs{DZnYoaaqpyHr}1FAB-3f)nmM;jDg6d1$$fcHgJ$qv^aJ$*)AsJYZ3!=_s|@JeY> z1%}lLx2sba?4gIW+={f^W?eei>bg7lVje|Dj3^%LMzvm>W_vD z>6(-xsQNq%1=0I5KVjMwkG?})ja^G)y zq?e7S4EqcFUB``K=l?kD!KRySo*0<9T=cy`(KcB|HgRwP_LUschrY>4(g2rnlY9eh zAb~j9(htNwWmAb2`}YOn^+~jAMN#7$tiwwJ;yaSFb~#v77^hYiwy3#FY~sjJE`}_Q V$QnKm@feS=fi;R#6tB~J`!BCy=F|WH literal 0 HcmV?d00001 diff --git a/APL2.1/TP4/Date/Testdate.java b/APL2.1/TP4/Date/Testdate.java new file mode 100644 index 0000000..41ca44b --- /dev/null +++ b/APL2.1/TP4/Date/Testdate.java @@ -0,0 +1,8 @@ +public class Testdate { + public static void main(String[] args) { + Date date = new Date(8,2,2022); + Date date2 = new Date(31, 1, 2022); + + System.out.println("Date du jour : " + date); + } +} \ No newline at end of file diff --git a/APL2.1/TP4/Lendemain/Date.class b/APL2.1/TP4/Lendemain/Date.class new file mode 100644 index 0000000000000000000000000000000000000000..d1fee7911caab90728ed1ba5a4873601272278ad GIT binary patch literal 1772 zcma)7(QX?>6g{)M_S&0Gvk9SzaT2#QZ5`K6N-4BWOet|x;VMoZQb1Ouij6&r-8j3( z-c(ATP{k91cOFrM)E6E=B2ZPRAJ9MOCm`_)5YFtTjj1h!Y~6e3`pnsT?%W+e|NH4P z0N1c$!NQp&k~pi(+sd4?FpKjRrg346pxhV)@+Jx<<^_y>>2?G}Ss=FSdqG1$ue=xBTCTUf5M`H4To$l4{Jl<1 z-fpTVCRf}*&MTme5lq?`f^B11nNzS$ykjGcD>mN6xPY_l`$0G8xb2Dz8h*Vy635j9 z-m~#Ot|f3?`5Tm{IEg-a{QA~?SqlWTO$zJDzbtn21X}h2xh>hqH?!pd3fRS#^tOYB zg+(lp@v;z@*mZYg$@gk*@L4lxFzN=b7jy+KWc!;ikToU>{0Q6`u%Vx#KQn;TL{T;5 zmcZMhxwjW#azSJspH*T%d1Z8-qG*@KUcZK+q=F-6I3wKkf8NfRw?kd4LQl%y2=- zSjq@7i$)0gBV`oGngD)cHIc?;&J{0pCND9{Q%8XlIZwNQtMrSwf@NNWYg~OozsY}z zI monthinyear) { + this.month = 1; + this.year +=1; + } + + } else { + this.day += 1; + } + + } + public String toString() { + int i; + String sday = Integer.toString(this.day); + String smonth = Integer.toString(this.month); + String syear = Integer.toString(this.year); + if (sday.length() < 2) { + for (i = 0; i<2-sday.length(); i++) { + sday = "0"+sday; + } + } + if (smonth.length() < 2) { + for (i = 0; i<2-smonth.length(); i++) { + smonth = "0"+smonth; + } + } + if (syear.length() < 4) { + for (i = 0; i<4-syear.length(); i++) { + syear = "0"+syear; + } + } + return syear+"-"+smonth+"-"+sday; + } +} \ No newline at end of file diff --git a/APL2.1/TP4/Lendemain/Lendemain.class b/APL2.1/TP4/Lendemain/Lendemain.class new file mode 100644 index 0000000000000000000000000000000000000000..37b5b7528a700cd9259aebe0ead4dbfee7d61ce9 GIT binary patch literal 979 zcmaJ=>uwT36#j(H^L;hK&RG6`g{o+ihpjvLrg zwtN~4n;J|F+YGUnwrk5*3}LJIks(s^I)WkDuwC(P*l!8{khdJNMEcxz8M4-wMwg%P zio@NbN>lo_dsJ0Gz3C18wm7g=@Jd6t9ib4rD%ijk7?fh4OQGaj8g3gXV22^~+Vf-} zeLi?A2|k)XdoeIZ(Q+CDn3lD0)R zqdQtU1N%k-?JAwIv60pbNu)?tp-n^y43vK$^f?ueu4=!}5N>=&qLqay4h7Xlvpe!`z1G+Z zhpn&fp1|%!X*}?c0)-daQ_VEqQIifVM>GFa0Aqs^1czA)SFGsM-Opgl~d^NdC4 zj5-N}^O-5<{NS`XSO160k}}CzBnorAZSGTgdH3QGnsNCHv}uM{G^S*VD1D1hYI)rU7#kibb-1dF)=|UK~0Ps3rA78x4~LfPYznx67<2}$?%D&N2cGbYDi#bZVoAla zffC9FRzy*J0!*#`Za-@Gc*iGdm3_frBGbAV`rIZ>Zb13$n6c$nn?%Yoq`G literal 0 HcmV?d00001 diff --git a/APL2.1/TP4/Progression/Progression.java b/APL2.1/TP4/Progression/Progression.java new file mode 100644 index 0000000..07e3948 --- /dev/null +++ b/APL2.1/TP4/Progression/Progression.java @@ -0,0 +1,9 @@ +public class Progression { + public static void main(String[] args) { + Compteur c = new Compteur(5); + for (int i=0;i<5;i++){ + System.out.println(c); + c.plusUn(); + } + } +} \ No newline at end of file