From 5858d4b3c9a6663676222468804b486b4c2d7ea7 Mon Sep 17 00:00:00 2001 From: areses1234 Date: Thu, 27 Mar 2025 21:01:34 +0100 Subject: [PATCH 1/2] Your message explaining the changes --- .idea/.gitignore | 3 + .idea/lab-java-basics.iml | 11 ++ .idea/misc.xml | 6 + .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 + out/production/lab-java-basics/Employee.class | Bin 0 -> 1503 bytes out/production/lab-java-basics/Intern.class | Bin 0 -> 1644 bytes out/production/lab-java-basics/Main.class | Bin 0 -> 4311 bytes src/Employee.java | 50 +++++++++ src/Intern.java | 27 +++++ src/Main.java | 104 ++++++++++++++++++ 11 files changed, 215 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/lab-java-basics.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 out/production/lab-java-basics/Employee.class create mode 100644 out/production/lab-java-basics/Intern.class create mode 100644 out/production/lab-java-basics/Main.class create mode 100644 src/Employee.java create mode 100644 src/Intern.java create mode 100644 src/Main.java diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/lab-java-basics.iml b/.idea/lab-java-basics.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/.idea/lab-java-basics.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..462edb0 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..505d07d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/out/production/lab-java-basics/Employee.class b/out/production/lab-java-basics/Employee.class new file mode 100644 index 0000000000000000000000000000000000000000..0298b8ff912cbeb803e90b15ebdcc479a8e36363 GIT binary patch literal 1503 zcmZ`(ZBNr+6g|)A+O2jl#z5ZGp{QGV8Tf{ZAt6NLk_AX+_+IdFlx*#?78AbtgZ!Yz zY2pWefIrH3@6(M*S3=U~?cQ_Gx#x~Qe}DZ3u!|QaQW!I!Sx7?{$e%eMoodVRn$?5j zGkFpU=&xMQ4R-{_%9W!mGRPV*E!==5ka^wiwEPPx1uV~L%i*z5A0jovuIn|oId|N` z1oDLCG$}{a_^x1Kiox<7KX60W_Xa5ZIBj8u6Y_!6a=I4>ABK;!m@_bMVF8O*h&L{R zP`0Ute@^tLBON-b8lr=mfWBep30JBB^{CylwOuhl(1yru7!J8 z7MN06u0jYH9R_T9RHHnqwsIs;Nw}|#hSoS%+wJc`4&qZG`Bf8ITjZ(P=$8&p~6?qi9DAw@H*(U)eAb}1eu zwbJ;gl_rH&6M}~MK7Ak1=@Z4JX`Q!!Lf9)k81`ZhIeV>#NqbuBq4-thKI9na^vzI> zEd7}nr%H@HhaAfE@+3k+1vZ^Ho|y=>V=l~ZUS*7_9rMxXeFdw1HdR_VK5c)8@r5=i zaA93t=2ejhFx@XAu!i-7Yv`Ft;B=DH* zi$-FIwLp^)$0`$6MX?#hVw2gxr^&n~<5;VNwRQ~_4;EuROXl_8SVmpiAgs-6uz1iI KYl}LN!t;MfTkKW< literal 0 HcmV?d00001 diff --git a/out/production/lab-java-basics/Intern.class b/out/production/lab-java-basics/Intern.class new file mode 100644 index 0000000000000000000000000000000000000000..95dec6511eb8e86c21941b686cf97222da0dabf0 GIT binary patch literal 1644 zcmb7ETTdHD7(HVg+n5c;BtUa1U0O(OhlJiQF_1bAByNly#fY}*(_kie*9 zWVY#drMo8s$D9*kTK61s&o$#VSLyGuhQ@lN6Y;#T74ncO(V)XHsS%49CR0(^sr}e! z?QXqjb!yGpi=PCpcC_sFcjPcZ%Xj>vpsThW!)Gdnyl-&W_(#64LmkNBj?z8s&{!4Bg&(=M~O;3ilv}151*R~Vd{;>)oz3U7p$>EW}#{UiC`N2TCb{wLR z!Q(u(u${#dGXqZrmM==r7TdC`ee;+6GTNrZFi!5N^bTAVE;oI@e>ALK zF7=4y9mn01p&DcU^N4+W|CQ?M>gePrA?ng~JC0UtveocB71UiBhAPbB87JpbPUEO% zu_Lhf@1~rHI4}NVIo=WGnc!^lZsK>1r#|;rxE3pSZ{M3szlNw3TlOikzf+jPC;U#+ z#kfr(jTt(A%F`FI6F$S|Jkgz!FB#J8zQWfLR1x1$W_*kIma;VUyrB}{P1+bjnaZu# zxO#zRt}-Cc_)`(md~9`&l!;<-^39!?#Cl6>gVQGUjmjxzxc-WzKX9Fgn|v4fE*Zre zECZ(~{f3pX+WV2#lprBB5tX1qLZ%R=0Mkrokyq&*uB*H;*D;UBT%TY8E!>Pq+cBMU x((QzF8qe?`Do>U1vPk`fRk1|lbskgLz-9!KLYi#@eemjf@S~! literal 0 HcmV?d00001 diff --git a/out/production/lab-java-basics/Main.class b/out/production/lab-java-basics/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..c7329a4afb7db292e0fbf26177984b709af87364 GIT binary patch literal 4311 zcmbVPYj7J^75=Uydspj~yxv4flqT`!;nsGH-MY1!*m=};l18a*rMBZ>r;x0rwY{;l zYowJM7uqHzlt-aZprLJ`w4snf1A#)4RwcC%Hv087zTzJX8NPU@T*fG;oOy! zNXQcyG^4Y3&pqedbH01dxqDx`n41UCjo(Y~z$?HfqYBjw%0YcrZ%gXdWLs?fpb>W% zsyCUI>1<)}Ha3lj5E;5Q|NlQfB-99yWdsl`TW@GC;}|Jg#?I2Jp+46W({9_HHZ5n! zNgH~qOM-$r0ji8eSj@0!0T~8ihHE4(GSZm0;>JTJOlz{MX+**jEETX!Mi|SBE@T}u z+18y->vI_f(XsQ=3`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Ky4pHfjjVjg39-@M>Bi1R9xv)?YLRj#&Mnsp=M5h#%<|8%Uh#ZnbH79UQSPIFl zkw7RA5}$$)3Pi-CGCO(cFFYPGhgR3qtLphrxO)C8dj1^k9EUF?hWv?$#BE7ATwfZs z>rf3Dmc#OVB;bt%L%~qs1lEM*P_Q*p8>;2*1?l1Ee$_^5jt0rEKX6+$Iowcc>pa>= z&*3I+>O49|)ti+jb)(vK4x7$m>)ryhSGiu@uHIVC+^MWqcd32l%zkCL8dGmCVGfR} z!^&E9q;60=hxZqa5_eQtqVB8PwV{Md>wiF5q3*A{8|4;srCyEK?fF}|tU+!~*6B}| z%bH4~I$bwVe_8e{Qk{Wt;CXzA;Zf}4qdOU1L`P>Z9DE6bkD`HZeDEwj%*nl+e3X;> zbNHl-)k&=RZxWZDGG)o7r(}WoK{;dj;L>0*&85FMErw2YixZU$d40-;FJzhV?yp1^E zU5~iiPfnqZ{HnpjIEDauQyiV4csZ|@G^6+u#Tewhg*M|c!pZAx!f||=I!_DT7`}qX zsgVtO-Xau^5rSi$H}M3Gd^q5F9Z%Az3WnzbPSB_t?~tEgBMpK1JdJpYcp{TLYw&d% z`PmWn48B1li5+JT5u(RX!`>#Op2jz6N4`aCQwJMAXINTERNSALARY){ + System.out.println("Intern "+getNameEmployee()+" age of "+getAge()+" in the "+getPositionEmployee()+ + " has a salary "+ getSalaryOfEmployee()+" it is over the limit "); + + }else{ + System.out.println("Intern "+getNameEmployee()+" age of "+getAge()+" in the "+getPositionEmployee()+ + " has a salary "+ getSalaryOfEmployee()+" it is normal limit "); + super.setSalaryOfEmployee(MAXINTERNSALARY); + } + + } + } \ No newline at end of file diff --git a/src/Main.java b/src/Main.java new file mode 100644 index 0000000..d65c7a8 --- /dev/null +++ b/src/Main.java @@ -0,0 +1,104 @@ +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class Main { + public static void main(String[] args) { + + String delimitation = "==========================================================="; + System.out.println(delimitation); + + int[] numbers = {10, 5, 20, 25, 30, 40}; + System.out.println("The numbers of the array are: " + Arrays.toString(numbers)); + + Arrays.sort(numbers); + System.out.println("The numbers of the array are after sorting : " + Arrays.toString(numbers)); + + int minValue = numbers[0]; + int maxValue = numbers[numbers.length - 1]; + int diffrence_Max_Min = maxValue - minValue; + int secondMinValue = numbers[1]; + + + System.out.println("Maximum value is: " + maxValue); + System.out.println("Minimum value is: " + minValue); + System.out.println("The diffrence between Maximum and Minimum value is: " + diffrence_Max_Min); + System.out.println("The second Minimum value is: " + secondMinValue); + + + System.out.println(delimitation); + System.out.println(""); + System.out.println("***The second method of resolving task 1 and 2 ***"); + System.out.println(""); + System.out.println(delimitation); + + int[] numberOfArray = {30, 25, 50, 95, 10, 65, 85, 70}; + System.out.println("The numbers of the array are: " + Arrays.toString(numberOfArray)); + + int max_Value = numberOfArray[0]; + int min_Value = numberOfArray[0]; + + + for (int i : numberOfArray) + if (i > max_Value) + max_Value = i; + + + System.out.println("Max value of the array is : " + max_Value); + + + for (int i : numberOfArray) + if (i < min_Value) + min_Value = i; + + + System.out.println("Min value of the array is : " + min_Value); + + int diffrence_Max_Min2 = max_Value - min_Value; + System.out.println("Diffrence of Max and Min of the array is : " + diffrence_Max_Min2); + System.out.println(delimitation); + + int secondNumber = numberOfArray[0]; + + for (int i : numberOfArray) + if (i < secondNumber && i > min_Value) + secondNumber = i; + + System.out.println("The second minimum value of the array is : " + secondNumber); + System.out.println(delimitation); + ArrayList employeesOfTheCompany = new ArrayList<>(); + employeesOfTheCompany.add(new Employee("Max", 41, "Site Manager", 100_000)); + employeesOfTheCompany.add(new Employee("Enis", 48, "Operation Manager OutBound", 80_000)); + employeesOfTheCompany.add(new Employee("Simon", 33, "Operation Manager Inbound", 75_000)); + employeesOfTheCompany.add(new Employee("Aslyan", 26, "Manager IB", 45_000)); + employeesOfTheCompany.add(new Intern("Alex", 35, " FC Associate IB ", 21_000)); + employeesOfTheCompany.add(new Intern("Ibrahim", 22, " FC Associate OB ", 19_000)); + employeesOfTheCompany.add(new Employee("Sam", 28, "Team Lead", 32_000)); + employeesOfTheCompany.add(new Intern("Taca", 31, " Ricever IB ", 22_000)); + employeesOfTheCompany.add(new Employee("Andy", 48, " Instructor IB", 25_000)); + employeesOfTheCompany.add(new Intern("Paul", 40, " Instructor OB ", 19_999)); + + for (Employee employee : employeesOfTheCompany) { + + if (employee instanceof Intern) { + + System.out.println("\nPresentation" + "\nName: " + employee.getNameEmployee() + "\nAge: " + employee.getAge() + "\nPosition in the Company: " + employee.getPositionEmployee() + "\nSalary: €" + employee.getSalaryOfEmployee()); + } + + else { + + System.out.println("\nPresentation" + "\nName: " + employee.getNameEmployee() + "\nAge: " + employee.getAge() + "\nPosition in the Company: " + employee.getPositionEmployee() + "\nSalary: €" + employee.getSalaryOfEmployee()); + } + + + + + } + + + } +} + + + + From 73293406f0a62616924bb928c38d564be6de73c8 Mon Sep 17 00:00:00 2001 From: Ardelean Alexandru Date: Sat, 29 Mar 2025 08:41:43 +0100 Subject: [PATCH 2/2] Update Intern.java --- src/Intern.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Intern.java b/src/Intern.java index 5a02115..d32cbbd 100644 --- a/src/Intern.java +++ b/src/Intern.java @@ -14,14 +14,14 @@ public void setSalary(int salary) { final int MAXINTERNSALARY = 20000; if (getSalaryOfEmployee()>MAXINTERNSALARY){ - System.out.println("Intern "+getNameEmployee()+" age of "+getAge()+" in the "+getPositionEmployee()+ + System.out.println("Presentation "+getNameEmployee()+" age of "+getAge()+" in the "+getPositionEmployee()+ " has a salary "+ getSalaryOfEmployee()+" it is over the limit "); }else{ - System.out.println("Intern "+getNameEmployee()+" age of "+getAge()+" in the "+getPositionEmployee()+ + System.out.println("Presentation "+getNameEmployee()+" age of "+getAge()+" in the "+getPositionEmployee()+ " has a salary "+ getSalaryOfEmployee()+" it is normal limit "); super.setSalaryOfEmployee(MAXINTERNSALARY); } } - } \ No newline at end of file + }