'Added USOS4 mockup;'

This commit is contained in:
Arkadiusz Hypki 2024-03-07 12:24:56 +01:00
parent 4a8e7fb1aa
commit 542c30a043
4 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,21 @@
package net.hypki.USOS4;
import net.hypki.USOS4.model.Faculty;
import net.hypki.USOS4.model.Person;
import net.hypki.USOS4.model.Student;
public class Main {
public static void main(String[] args) {
System.out.println("Hello");
Student s = new Student();
s.setName("Jan");
s.setSurname("Kowalski");
System.out.println(s.toString());
// Person p = new Person();
Faculty f = new Faculty();
}
}

View File

@ -0,0 +1,26 @@
package net.hypki.USOS4.model;
public class Faculty extends Person {
private String department = null;
@Override
public String toString() {
return super.toString()
+ "(" + getDepartment() + ")";
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
@Override
public void terminate() {
// 1. dont pay anymore
// 2. switch off cards
}
}

View File

@ -0,0 +1,31 @@
package net.hypki.USOS4.model;
public abstract class Person {
private String name = null;
private String surname = null;
public abstract void terminate();
@Override
public String toString() {
return getName() + " " + getSurname();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
}

View File

@ -0,0 +1,24 @@
package net.hypki.USOS4.model;
public class Student extends Person {
private int indexNr = 0;
@Override
public String toString() {
return super.toString() + ", nr indeksu " + getIndexNr();
}
public int getIndexNr() {
return indexNr;
}
public void setIndexNr(int indexNr) {
this.indexNr = indexNr;
}
@Override
public void terminate() {
// 1. remove from all classes
}
}