Skip to content

Lab completed. #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Lab1.06/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
3 changes: 3 additions & 0 deletions Lab1.06/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Lab1.06/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Lab1.06/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Lab1.06/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions Lab1.06/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Name : Jack Hawk
Email : [email protected]
Age : 48
Wage 46001.3
Name : Janice Hale
Email : [email protected]
Age : 39
Wage 25000.0
Name : Nicky Kelly
Email : [email protected]
Age : 35
Wage 35000.0
Name : Chihiro Osaka
Email : [email protected]
Age : 38
Wage 22000.3
Name : Ulrich Schneider
Email : [email protected]
Age : 29
Wage 20100.1
Name : Naga Naga
Email : [email protected]
Age : 35
Wage 34500.0
Name : Yehu Joab
Email : [email protected]
Age : 21
Wage 26500.7
Name : Jackie Hawke
Email : [email protected]
Age : 48
Wage 44000.1
Name : Julius Maximus
Email : [email protected]
Age : 30
Wage 31000.9
Name : Yuki Oh
Email : [email protected]
Age : 23
Wage 17000.0
17 changes: 17 additions & 0 deletions Lab1.06/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>Ironhack.schl</groupId>
<artifactId>Lab1.06</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>
60 changes: 60 additions & 0 deletions Lab1.06/src/main/java/Ironhack/schl/Employee.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package Ironhack.schl;

public class Employee {

private String name;
private String email;
private int age;
private double salary;

// Constructor

public Employee(String name, String email, int age, double salary) {
this.name = name;
this.email = email;
this.age = age;
this.salary = salary;
}
//Getters

public String getName() {
return name;
}

public String getEmail() {
return email;
}

public int getAge() {
return age;
}

public double getSalary() {
return salary;
}

// Setters

public void setName(String name) {
this.name = name;
}

public void setEmail(String email) {
this.email = email;
}

public void setAge(int age) {
this.age = age;
}

public void setSalary(double salary) {
this.salary = salary;
}

@Override
public String toString() {
return "Name : " + getName() + "\n" + "Email : " +
getEmail() + "\n" + "Age : " + getAge()
+ "\n" + "Wage " + getSalary();
}
}
35 changes: 35 additions & 0 deletions Lab1.06/src/main/java/Ironhack/schl/Intern.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package Ironhack.schl;

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

public class Intern extends Employee {
public final double SALARY_LIMIT = 20000.0;
private double internSalary;
private boolean isIntern;

public Intern(String name, String email, int age, double salary, boolean isIntern) {
super(name, email, age, salary);
isIntern = true;
}

public boolean isIntern() {
return this.isIntern;
}

public void setIntern(boolean isIntern) {
this.isIntern = true;
}

public void internMembership(double salary, double SALARY_LIMIT, boolean isIntern) {
if (salary <= SALARY_LIMIT) {
isIntern = true;
System.out.println(isIntern);
} else {
System.out.println("Employee");
}

}
}
35 changes: 35 additions & 0 deletions Lab1.06/src/main/java/Ironhack/schl/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package Ironhack.schl;

import java.io.*;

public class Main {
public static void main(String[] args) throws FileNotFoundException {
Employee employee1 = new Employee("Jack Hawk", "[email protected]",48,46001.3);
Employee employee2 = new Employee("Janice Hale", "[email protected]",39,25000);
Employee employee3 = new Employee("Nicky Kelly", "[email protected]",35,35000);
Employee employee4 = new Employee("Chihiro Osaka", "[email protected]",38,22000.3);
Employee employee5 = new Employee("Ulrich Schneider", "[email protected]",29,20100.1);
Employee employee6 = new Employee("Naga Naga", "[email protected]",35,34500);
Employee employee7 = new Employee("Yehu Joab", "[email protected]",21,26500.7);
Employee employee8 = new Employee("Jackie Hawke", "[email protected]",48,44000.1);
Employee employee9 = new Employee("Julius Maximus", "[email protected]",30,31000.9);

PrintStream out = new PrintStream(new FileOutputStream("output.txt"));
System.setOut(out);

System.out.println(employee1);
System.out.println(employee2);
System.out.println(employee3);
System.out.println(employee4);
System.out.println(employee5);
System.out.println(employee6);
System.out.println(employee7);
System.out.println(employee8);
System.out.println(employee9);

Intern intern1 = new Intern("Yuki Oh", "[email protected]",23,17000,false);
System.out.println(intern1);
}


}