From 1a8aa5ceee8f0a932e2add5275049b3ea85b3881 Mon Sep 17 00:00:00 2001 From: yaqutrslbyl Date: Fri, 20 Feb 2026 05:18:02 -0800 Subject: [PATCH] Lab is completed --- .idea/.gitignore | 10 ++++ .idea/lab-java-standard-input-and-classes.iml | 11 ++++ .idea/misc.xml | 6 ++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 ++ .../main/lab2.class | Bin 0 -> 447 bytes src/main/Employee.java | 52 ++++++++++++++++++ src/main/Intern.java | 31 +++++++++++ src/main/main.java | 34 ++++++++++++ 9 files changed, 158 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/lab-java-standard-input-and-classes.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-standard-input-and-classes/main/lab2.class create mode 100644 src/main/Employee.java create mode 100644 src/main/Intern.java create mode 100644 src/main/main.java diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..ab1f416 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/lab-java-standard-input-and-classes.iml b/.idea/lab-java-standard-input-and-classes.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/.idea/lab-java-standard-input-and-classes.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..f5bd2df --- /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..398d0f7 --- /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-standard-input-and-classes/main/lab2.class b/out/production/lab-java-standard-input-and-classes/main/lab2.class new file mode 100644 index 0000000000000000000000000000000000000000..366240a14ea80dda4c4c36f528d6f3246f8c6c90 GIT binary patch literal 447 zcmZvZO-sW-5Qg9BSDG~1np(fLco13-2E0bRh@OH9mEJdXX}2UBNfW`Jr3VEM{s4cJ zINO$j;2vgnX5aT=cK7?|^9#T=x(-SxTd26GqDE*<#k25Zp~wDRG?k;AP`glC<(GtV zuRpX=hi$=e(SZ9$K6shsGGSF(u&EQyK`Qm{Go|xEo=K4eb*vMr6B);;gBCU{crM!5 zB((pL6Ram=jy3ao3*dY*rYSuR`a=s_1UnH*^T^RTp>mZzNMAX_INTERN_SALARY){ + System.err.println("Intern salary should not above 20000"); + } + + } + + public void setSalary(double salary){ + if(salary>MAX_INTERN_SALARY){ + System.err.println("Intern salary should not above 20000"); + + } + else{ + super.setSalary(salary); + } + } + + public double getInternSalary(){ + return salary; + } + + public double getMAX_INTERN_SALARY(){ + return MAX_INTERN_SALARY; + } + +} diff --git a/src/main/main.java b/src/main/main.java new file mode 100644 index 0000000..123dd61 --- /dev/null +++ b/src/main/main.java @@ -0,0 +1,34 @@ +package main; + +import java.io.FileWriter; +import java.io.IOException; +import java.lang.ref.WeakReference; + +public class main { + + public static void main() throws IOException { + Employee[] employees=new Employee[10]; + employees[0]=new Employee("Yaqut","yaqut@gmail.com", 20, 3000); + + employees[1]=new Employee("Aysun","aysun@gmail.com", 20, 3000); + employees[2]=new Employee("Vusale","vusu@gmail.com", 20, 20); + employees[4]=new Employee("Nezrin","nezrin@gmail.com", 20, 2500); + employees[5]=new Employee("Murad","murad@gmail.com", 15, 1500); + employees[6]=new Employee("konbili","konbili@gmail.com", 20, 3000); + employees[7]=new Employee("gunay","gunay@gmail.com", 20, 30); + employees[8]=new Employee("nihad","nihad@gmail.com", 20, 600); + employees[9]=new Employee("emin","emin@gmail.com", 20, 700); + + try (FileWriter writer = new FileWriter("employees.txt")){ + for(int i=0; i<10; i++){ + writer.write("name"+employees[i].getName()+"\n"); + writer.write("email"+employees[i].getEmail()+ "\n"); + writer.write("age"+employees[i].getAge()+ "\n"); + writer.write("Salary"+employees[i].getSalary()+ "\n"); + + } + } + + + } +}