Skip to content
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

JS11_Zidan Shabira As Sidiq_1941720144 #20

Open
wants to merge 1 commit into
base: master
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
14 changes: 14 additions & 0 deletions PBO_Jobsheet10_1941720144/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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>com.mycompany</groupId>
<artifactId>PBO_Jobsheet10_1941720144</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>13</maven.compiler.source>
<maven.compiler.target>13</maven.compiler.target>
</properties>
<name>PBO_Jobsheet11_1941720144</name>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package interfacelatihan;

/**
*
* @author Zidan
*/
public interface IBerprestasi {
public abstract void menjuaraiKompetisi();
public abstract void membuatPublikasiIlmiah();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package interfacelatihan;

/**
*
* @author Zidan
*/
public interface ICumlaude {
public abstract void lulus();
public abstract void meraihIPKTinggi();
public abstract void kuliahDiKampus();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package interfacelatihan;

/**
*
* @author Zidan
*/
public class Mahasiswa {
protected String nama;

public Mahasiswa(String nama){
this.nama=nama;
}

public void kuliahDiKampus(){
System.out.println("Aku mahasiswa, namaku "+this.nama);
System.out.println("Aku berkuliah di kampus.");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package interfacelatihan;
import interfacelatihan.ICumlaude;
import interfacelatihan.Mahasiswa;
import interfacelatihan.PascaSarjana;
import interfacelatihan.Rektor;
import interfacelatihan.Sarjana;
/**
*
* @author Zidan
*/
public class MultipleInterfaceMain {
public static void main(String[] args) {
Rektor pakrektor=new Rektor();

Sarjana sarjanaCum=new Sarjana("Dini");
PascaSarjana masterCum=new PascaSarjana("Elok");

//pakrektor.beriSertifikatMAwapres(sarjanaCum);
pakrektor.beriSertifikatMAwapres(masterCum);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package interfacelatihan;

/**
*
* @author Zidan
*/
public class PascaSarjana extends Mahasiswa implements ICumlaude, IBerprestasi{
public PascaSarjana(String nama){
super(nama);
}

@Override
public void lulus() {
System.out.println("Aku usdah menyelesaikan TESIS");
}

@Override
public void meraihIPKTinggi() {
System.out.println("IPK-ku lebih dari 3,71");
}

@Override
public void menjuaraiKompetisi() {
System.out.println("Saya telah menjuarai kompetisi INTERNASIONAL");
}

@Override
public void membuatPublikasiIlmiah() {
System.out.println("Saya menerbitkan artikel di jurnal INTERNASIONAL");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package interfacelatihan;

/**
*
* @author Zidan
*/
public class Rektor {
public void beriSertifikatICumlaude(ICumlaude mahasiswa){
System.out.println("Saya REKTOR, memberikan sertifikat cumlaude");
System.out.println("Selamat! silahkan perkenalkan diri Anda..");

mahasiswa.lulus();
mahasiswa.meraihIPKTinggi();
mahasiswa.kuliahDiKampus();

System.out.println("-------------------------------------------");
}

public void beriSertifikatMAwapres(IBerprestasi mahasiswa){
System.out.println("Saya REKTOR, memberikan sertifikat MAWAPRES");
System.out.println("Selamat! Bagaimana Anda bisa berprestasi?");

mahasiswa.menjuaraiKompetisi();
mahasiswa.membuatPublikasiIlmiah();


System.out.println("-------------------------------------------");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package interfacelatihan;

/**
*
* @author Zidan
*/
public class Sarjana extends Mahasiswa implements ICumlaude{
public Sarjana(String nama){
super(nama);
}

@Override
public void lulus() {
System.out.println("Aku sudah menyelesaikan SKRIPSI");
}

@Override
public void meraihIPKTinggi() {
System.out.println("IPK-ku lebih dari 3,51");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package interfacelatihan;
import interfacelatihan.ICumlaude;
import interfacelatihan.Mahasiswa;
import interfacelatihan.PascaSarjana;
import interfacelatihan.Rektor;
import interfacelatihan.Sarjana;
/**
*
* @author Zidan
*/
public class interfacemain {
public static void main(String[] args) {
Rektor pakrektor=new Rektor();

Mahasiswa mhsBiasa=new Mahasiswa("Charlie");
Sarjana sarjanaCumlaude=new Sarjana("Dini");
PascaSarjana masterCumlaude=new PascaSarjana("Elok");

// pakrektor.beriSertifikatICumlaude(mhsBiasa);
pakrektor.beriSertifikatICumlaude(sarjanaCumlaude);
pakrektor.beriSertifikatICumlaude(masterCumlaude);
sarjanaCumlaude.kuliahDiKampus();
}
}
Binary file added PBO_Jobsheet10_1941720144/src/main/java/tugas.rar
Binary file not shown.
38 changes: 38 additions & 0 deletions PBO_Jobsheet10_1941720144/src/main/java/tugas/Binatang.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tugas;

/**
*
* @author Zidan
*/
public abstract class Binatang {
protected String nama;
protected int jmlKaki;

public Binatang(String nama, int jmlKaki){
this.nama=nama;
this.jmlKaki=jmlKaki;
}

public void setNama(String nama){
this.nama=nama;
}

public String getNama(){
return nama;
}

public void setKaki(int jmlKaki){
this.jmlKaki=jmlKaki;
}

public int getKaki(int jmlKaki){
return jmlKaki;
}

public abstract void displayBinatang();
}
37 changes: 37 additions & 0 deletions PBO_Jobsheet10_1941720144/src/main/java/tugas/Gorilla.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tugas;

/**
*
* @author Zidan
*/
public class Gorilla extends Binatang implements IKarnivora, IHerbivora{
private String suara;
private String warnaBulu;

public Gorilla(String nama, int jmlKaki, String suara, String warnaBulu){
super(nama, jmlKaki);
this.suara=suara;
this.warnaBulu=warnaBulu;
}

@Override
public void displayBinatang() {
System.out.println("Nama Hewan :"+super.nama);
System.out.println("Jumlah Kaki :"+super.jmlKaki);
}

@Override
public void displayMakan() {
System.out.println("Gorilla adalah jenis Hewan Karnivora dan juga Herbivora");
}

public void displayData(){
System.out.println("Suara: "+this.suara);
System.out.println("Warna Bulu :"+this.warnaBulu);
}
}
14 changes: 14 additions & 0 deletions PBO_Jobsheet10_1941720144/src/main/java/tugas/IHerbivora.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tugas;

/**
*
* @author Zidan
*/
public interface IHerbivora {
public void displayMakan();
}
14 changes: 14 additions & 0 deletions PBO_Jobsheet10_1941720144/src/main/java/tugas/IKarnivora.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tugas;

/**
*
* @author Zidan
*/
public interface IKarnivora {
public void displayMakan();
}
37 changes: 37 additions & 0 deletions PBO_Jobsheet10_1941720144/src/main/java/tugas/Keledai.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tugas;

/**
*
* @author Zidan
*/
public class Keledai extends Binatang implements IHerbivora{
private String suara;
private String warnaBulu;

public Keledai(String nama, int jmlKaki, String suara, String warnaBulu){
super(nama, jmlKaki);
this.suara=suara;
this.warnaBulu=warnaBulu;
}

@Override
public void displayBinatang() {
System.out.println("Nama Hewan :"+super.nama);
System.out.println("Jumlah Kaki :"+super.jmlKaki);
}

@Override
public void displayMakan() {
System.out.println("Keledai adalah jenis Hewan Herbivora");
}

public void displayData(){
System.out.println("Suara: "+this.suara);
System.out.println("Warna Bulu :"+this.warnaBulu);
}
}
Loading