Vous êtes sur la page 1sur 8

MAIN System.out.println(stud.

getYearLevel());

package midproject; System.out.println(" ");

public class MidProject {

public static void main(String[] args) { Teacher teach = new Teacher("jesse", "seva",
28, "Teacher", "DCIS", 12000);
person boy = new person("john", "doe", 19);
System.out.println("===Teacher===");
System.out.println("===Person===");

System.out.println("firstname:"+teach.getFirstName
System.out.println("firstname:"+boy.getFirstName()) ());
;
System.out.println("salary:"+teach.getSalary());

System.out.println("lastname:"+boy.getLastName());
System.out.println("Profesion:"+teach.getProfesion()
System.out.println("age:"+boy.getAge()); );
boy.Grow(); System.out.println(" ");

System.out.println(boy.getAge());

System.out.println(" "); Profesional prof=new


Profesional("JaYAnn","Carzon",25,60,150,"Educator"
,7000);

System.out.println("===Professional===");
Student stud=new Student("monica",
"dinglasa", 20,
System.out.println("Name:"+prof.getFirstName()+"
40, 145, "IT",1); "+prof.getLastName());

System.out.println("===Student===");
System.out.println("Profession:"+prof.getProfesion()
);
System.out.println("NAMe:"+stud.getFirstName()+"
"+stud.getLastName()); System.out.println("salary:"+prof.getSalary());

prof.Grow();
System.out.println("Yearlevel:"+stud.getYearLevel());
System.out.println(prof.getSalary());
System.out.println("Course:"+stud.getCourse());
System.out.println(" ");
stud.Grow();
PNStudent.ITAdmin.firstName = "zombie";

PNStudent.ITAdmin.lastName = "dinglasa";

PNStudent zombie = new PNStudent(new


Teacher("Rene", "Abdallah", 28, "Teacher", System.out.println(PNStudent.ITAdmin.firstName);
"ITadmin", 12345), "usc");

zombie.PNStudentTeacher(); System.out.println(PNStudent.ITAdmin.lastName);

zombie.Grow(6);

System.out.println("===programmer===");

Programmer c = new Programmer("JErome",


"burce", 30, "programmer", 30000, 3, "c##", "web
// PNStudent burce=new PNStudent(new dev");
Teacher("Sinead", "sios-e", 28, "Teacher", "ITadmin",
12345), "usc"); c.Status();

// burce.PNStudentITAdmin();

// System.out.println("NAme:"+c.getFirstName());

// PNStudent obj = new PNStudent("monica", System.out.println("Your masterlanguage and


"dinglasa", 12, "IT", 1); fieldmaster is: "+c.Language());

// obj.Grow(); //c.fieldMaster = "database administrator";

// System.out.println("===Student==="); //System.out.println("Your fieldmaster is:"+


c.fieldMaster);
//

// System.out.println("age:" +
obj.getYearLevel()); Programmer.ContractStatus sample = new
Programmer.ContractStatus(2012, 2017);
//
System.out.println("name:"+obj.getFirstName());
System.out.println(Programmer.ContractStatus.displ
// ayStatus());
System.out.println("Course:"+obj.getCourse());
c.Grow();
// System.out.println(" ");
System.out.println("Your salary
// is:"+c.getSalary());

}
Student zonbie = new PNStudent(new }
Teacher("Rene", "Abdallah", 12, "Teacher", "PN",
12345), "usc"); PROFESsional
package midproject; this.profesion = profesion;

public class Profesional extends person {

public double getSalary() {

private String profesion; return salary;

private double salary; }

public Profesional(String firstName, String public void setProfeson(double salary) {


lastName, int age, String profesion, double salary) {
this.salary = salary;
super(firstName, lastName, age);
}
this.profesion = profesion;

this.salary = salary;
@Override
}
public void Grow() {

super.Grow();
public Profesional(String firstName, String
lastName, this.salary += (this.salary * .1);

int age, int weight, int height, String }


profesion, double salary) {

super(firstName, lastName, age, weight, height);


@Override
this.profesion = profesion;
public void Grow(int years) {
this.salary = salary;
super.Grow();
}
this.salary += this.salary * (years * .1);

}
public String getProfesion() {

return profesion;
}
}
PROGRammer

package midproject;
public void setProfeson(String profesion) {
public class Programmer extends Profesional { System.out.println(level);

static Object Programmer; }

private String level;

private int yearsExperience; public String Language() {

static String masterLanguage; this.masterLanguage = masterLanguage;

static String fieldMaster; this.fieldMaster = fieldMaster;

return masterLanguage + ", " + fieldMaster;

public Programmer(String firstName, String }


lastName, int age, String profesion, double salary, int
yearsExperience, String masterLanguage, String
fieldMaster) {
public class Ocassion {
super(firstName, lastName, age, profesion,
salary);
private String holiday;
this.yearsExperience = yearsExperience;
private double leave;
this.masterLanguage = masterLanguage;

this.fieldMaster = fieldMaster;
public void Leave(String holiday, double leave) {
}
this.holiday = holiday;

if (this.holiday == "Special Holidays") {


public void Status() {
this.leave = 2;
if (this.yearsExperience >= 8) {
} else {
this.level = "Senior Programmer";
this.leave = 0;
System.out.println(level);
}
} else if (yearsExperience >= 3 &&
yearsExperience < 8) {

this.level = "Midddle Programmer"; }

System.out.println(level);

} else { }

this.level = "Junior Programmer";


public static class ContractStatus { private int yearLevel;

static int started; public Student(String firstName, String lastName,


int age,
static int end;
String course, int yearLevel) {
private double yearsExperience;
super(firstName, lastName, age);

this.course = course;
public ContractStatus(int started, int end) {
this.yearLevel = yearLevel;
this.started = started;
}
this.end = end;

}
public Student() {

}
public static String displayStatus() {

int result = ContractStatus.end -


ContractStatus.started; public Student(String firstName, String lastName,
int age,
return String.format("Your contract is %s
years and will end at %s.", result, int weight, int height, String course, int
ContractStatus.end); yearLevel) {

super(firstName, lastName, age, weight, height);

} this.course = course;

this.yearLevel = yearLevel;

} }

Student public String getCourse() {

package midproject; return course;

public class Student extends person {

public void setCourse(String course) {

private String course; this.course = course;


} public class Teacher extends Profesional {

public int getYearLevel() {

return yearLevel; private String department;

public Teacher(String firstName, String lastName,


int age,String profesion, String department, double
public void setYearLevel(int yearLevel) { salary){

this.yearLevel = yearLevel; super(firstName, lastName, age, profesion,


salary);
}
this.department = department;

}
@Override

public void Grow() {


public Teacher(String firstName, String lastName,
super.Grow();
int age, int height, int weight, String profesion, String
this.yearLevel += 1; department, double salary){

} super(firstName, lastName, age, height, weight,


profesion, salary);

this.department = department;
@Override
}
public void Grow(int years) {

super.Grow(years);

this.yearLevel =this.yearLevel+1;
public String getDepartment(){
}
return department;
}

Teacher
}

package midproject;
public void setDepartment(String department){

this.department = department;
}

public person(String firstName, String lastName,


int age,
@Override
int weight, int height) {
public void Grow(){
this.firstName = firstName;
super.Grow();
this.lastName = lastName;
}
this.age = age;

this.weight = weight;
@Override
this.height = height;
public void Grow(int years){
}
super.Grow(years);

}
public person(String firstName, String lastName,
} int age) {

this.firstName = firstName;

PERson this.lastName = lastName;

package midproject; this.age = age;

public class person {

public String getFirstName() {

private String firstName; return firstName;

private String lastName; }


int age;

private int weight; public void setFirstName(String firstName) {

private int height; this.firstName = firstName;

public person() {

public String getLastName() {


} return lastName;
} this.height = height;

public void setLastName(String lastName) {

this.lastName = lastName; public void Grow() {

this.age += 1;

public int getAge() { }

return age;

} public void Grow(int years) {

this.age += years;

public void setAge(int age) { }

this.age = age;

} }

public int getWeight() {

return weight;

public void setWeight(int weight) {

this.weight = weight;

public int getHeight() {

return height;

public void setHeight(int height) {

Vous aimerez peut-être aussi