diff --git a/lab-1/src/Employee.java b/lab-1/src/Employee.java
new file mode 100644
index 0000000..aa94611
--- /dev/null
+++ b/lab-1/src/Employee.java
@@ -0,0 +1,49 @@
+public class Employee {
+ private String name;
+ private int id;
+ private String department;
+ private double salary;
+ private boolean isEmployed;
+
+ public Employee(String name, int id, String department, double salary, boolean isEmployed) {
+ this.name = name;
+ this.id = id;
+ this.department = department;
+ this.salary = salary;
+ this.isEmployed = isEmployed;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public int getId() {
+ return id;
+ }
+ public void setId(int id) {
+ this.id = id;
+ }
+ public String getDepartment() {
+ return department;
+ }
+ public void setDepartment(String department) {
+ this.department = department;
+ }
+ public double getSalary() {
+ return salary;
+ }
+ public void setSalary(double salary) {
+ this.salary = salary;
+ }
+ public Boolean isEmployed() {
+ return isEmployed;
+ }
+ public void setEmployed (boolean employed) {
+ this.isEmployed = employed;
+ }
+ public String toString() {
+ return "Employee [ID=" + id + ", Name=" + name + ", Department=" + department
+ + ", Salary=" + salary + ", Employed=" + isEmployed + "]";
+ }
+}
diff --git a/lab-1/src/Intern.java b/lab-1/src/Intern.java
new file mode 100644
index 0000000..70036a3
--- /dev/null
+++ b/lab-1/src/Intern.java
@@ -0,0 +1,30 @@
+public class Intern extends Employee {
+ private static final double MAX_SALARY = 20000;
+
+ public Intern(String name, int id, String department, double salary, boolean isEmployed) {
+ super(name, id, department, validateSalary(salary), isEmployed);
+ super.setEmployed(isEmployed);
+ }
+ public Intern(String name, int id, String department, double salary) {
+ this(name, id, department, salary, true);
+ }
+ private static double validateSalary(double salary) {
+ if (salary > MAX_SALARY) {
+ System.out.println("Salary exceeds the limit for an Intern. Setting to " + MAX_SALARY);
+ return MAX_SALARY;
+ }
+ return salary;
+ }
+ public void setSalary(double salary) {
+ if (salary > MAX_SALARY) {
+ System.out.println("Salary exceeds limit for an Intern. Setting to within " + MAX_SALARY);
+ super.setSalary(MAX_SALARY);
+ } else {
+ super.setSalary(salary);
+ }
+ }
+ public String toString() {
+ return "Intern [ID=" + getId() + ", Name=" + getName() + ", Department=" + getDepartment()
+ + ", Salary=" + getSalary() + ", Employed=" + isEmployed() + "]";
+ }
+}
diff --git a/lab-1/src/Main.java b/lab-1/src/Main.java
new file mode 100644
index 0000000..95a0c20
--- /dev/null
+++ b/lab-1/src/Main.java
@@ -0,0 +1,22 @@
+//TIP To Run code, press or
+// click the icon in the gutter.
+public class Main {
+ public static void main(String[] args) {
+ Employee[] employees_list = new Employee[10];
+
+ employees_list[0] = new Employee("Vanessa", 1, "HR", 50000, true);
+ employees_list[1] = new Employee("Vanessa_2", 2, "HR", 70000, true);
+ employees_list[2] = new Employee("Vanessa_3", 3, "HR", 45000, true);
+ employees_list[3] = new Employee("Vanessa_4", 4, "HR", 52000, true);
+ employees_list[4] = new Employee("Vanessa_5", 5, "HR", 50000, true);
+ employees_list[5] = new Employee("Vanessa_6", 6, "HR", 50000, true);
+ employees_list[6] = new Employee("Vanessa_7", 7, "HR", 50000, false);
+ employees_list[7] = new Employee("Vanessa_8", 8, "HR", 50000, false);
+ employees_list[8] = new Intern("Vanessa_9", 9, "HR", 21000, true);
+ employees_list[9] = new Intern("Audrey", 10, "HR", 15000, true);
+
+ for (Employee emp : employees_list) {
+ System.out.println(emp);
+ }
+ }
+}
\ No newline at end of file
diff --git a/lab-1/src/arrayDiff.java b/lab-1/src/arrayDiff.java
new file mode 100644
index 0000000..e8e62e1
--- /dev/null
+++ b/lab-1/src/arrayDiff.java
@@ -0,0 +1,23 @@
+public class arrayDiff {
+
+ public static int getDiff (int[] nums) {
+ int minimum = nums[0];
+ int maximum = nums[0];
+
+ for (int i = 1; i < nums.length; i++) {
+ if (nums[i] < minimum) {
+ minimum = nums[i];
+ } else if (nums[i] > maximum) {
+ maximum = nums[i];
+ }
+ }
+
+ return maximum - minimum;
+ }
+
+ public static void main(String[] args) {
+ int[] numbers = {-3, -2, -2, -1, 0, 1, 2, 3, 3, 4};
+ int difference = getDiff(numbers);
+ System.out.println("The difference between the largest and smallest integer in the array is: " +difference);
+ }
+}
diff --git a/lab-1/src/twoSmallest.java b/lab-1/src/twoSmallest.java
new file mode 100644
index 0000000..4c72521
--- /dev/null
+++ b/lab-1/src/twoSmallest.java
@@ -0,0 +1,31 @@
+public class twoSmallest {
+
+ public static void findTwoSmallest(int[] nums) {
+ int smallest = Integer.MAX_VALUE;
+ int secondSmallest = Integer.MAX_VALUE;
+
+ for (int i = 0; i < nums.length; i++) {
+ int current = nums[i];
+
+ if (current < smallest) {
+ secondSmallest = smallest;
+ smallest = current;
+ } else if (current < secondSmallest && current != smallest) {
+ secondSmallest = current;
+ }
+ }
+ if (secondSmallest == Integer.MAX_VALUE) {
+ System.out.println("Array does not have a second smallest element");
+ } else {
+ System.out.println("Smallest: " + smallest);
+ System.out.println("Second Smallest: "+ secondSmallest);
+ }
+ }
+
+ public static void main(String[] args) {
+ int[] numbers = {-3, -2, -2, -1, 0, 1, 2, 3, 3, 4};
+ int[] numbers_2 = {1, 2, 3, 4, 5};
+ findTwoSmallest(numbers);
+ findTwoSmallest(numbers_2);
+ }
+}