Skip to content
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
3 changes: 3 additions & 0 deletions .idea/.gitignore

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

9 changes: 9 additions & 0 deletions .idea/lab-java-standard-input-and-classes.iml

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

6 changes: 6 additions & 0 deletions .idea/misc.xml

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

9 changes: 9 additions & 0 deletions .idea/modules.xml

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

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

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

11 changes: 11 additions & 0 deletions lab-input-and-classes/lab-input-and-classes.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
55 changes: 55 additions & 0 deletions lab-input-and-classes/src/Employee.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
public class Employee {
private String name;
private String email;
private int age;
private double salary;

public Employee(String name, String email, int age, double salary) {
setName(name);
setEmail(email);
setAge(age);
setSalary(salary);
}

public String getName() {
return name;
}

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

public String getEmail() {
return email;
}

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

public int getAge() {
return age;
}

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

public double getSalary() {
return salary;
}

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

@Override
public String toString() {
return "Employee{" +
"name='" + name + '\'' +
", email='" + email + '\'' +
", age=" + age +
", salary=" + salary +
'}';
}
}
18 changes: 18 additions & 0 deletions lab-input-and-classes/src/Intern.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
public class Intern extends Employee{
private static final double SALARY_LIMIT = 20000;
private double salary;

public Intern(String name, String email, int age, double salary){
super(name, email, age, salary);
setSalary(salary);
}

public double getSalary(){
return this.salary;
}

public void setSalary(double salary){
this.salary = Math.min(salary, SALARY_LIMIT);
}

}
16 changes: 16 additions & 0 deletions lab-input-and-classes/src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import javax.sound.midi.Soundbank;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {

Employee employee1 = new Employee("Henry", "[email protected]", 46, 30000);
Intern intern1 = new Intern("John", "[email protected]", 33, 10000);

System.out.println(employee1.getEmail());
System.out.println(intern1.getSalary());


}
}
Binary file not shown.
Binary file added out/production/lab-input-and-classes/Intern.class
Binary file not shown.
Binary file added out/production/lab-input-and-classes/Main.class
Binary file not shown.