diff --git a/PBO_Jobsheet10_1941720144/pom.xml b/PBO_Jobsheet10_1941720144/pom.xml new file mode 100644 index 0000000..7336549 --- /dev/null +++ b/PBO_Jobsheet10_1941720144/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.mycompany + PBO_Jobsheet10_1941720144 + 1.0-SNAPSHOT + jar + + UTF-8 + 13 + 13 + + PBO_Jobsheet11_1941720144 + \ No newline at end of file diff --git a/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/IBerprestasi.java b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/IBerprestasi.java new file mode 100644 index 0000000..b55f66d --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/IBerprestasi.java @@ -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(); +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/ICumlaude.java b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/ICumlaude.java new file mode 100644 index 0000000..21ff7fa --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/ICumlaude.java @@ -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(); +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/Mahasiswa.java b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/Mahasiswa.java new file mode 100644 index 0000000..90087a9 --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/Mahasiswa.java @@ -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."); + } +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/MultipleInterfaceMain.java b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/MultipleInterfaceMain.java new file mode 100644 index 0000000..753aba6 --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/MultipleInterfaceMain.java @@ -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); + } +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/PascaSarjana.java b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/PascaSarjana.java new file mode 100644 index 0000000..e25b93c --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/PascaSarjana.java @@ -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"); + } +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/Rektor.java b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/Rektor.java new file mode 100644 index 0000000..2e57935 --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/Rektor.java @@ -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("-------------------------------------------"); + } +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/Sarjana.java b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/Sarjana.java new file mode 100644 index 0000000..f9f3e8f --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/Sarjana.java @@ -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"); + } + +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/interfacemain.java b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/interfacemain.java new file mode 100644 index 0000000..c8bf3f9 --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/interfacelatihan/interfacemain.java @@ -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(); + } +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/tugas.rar b/PBO_Jobsheet10_1941720144/src/main/java/tugas.rar new file mode 100644 index 0000000..edb9e87 Binary files /dev/null and b/PBO_Jobsheet10_1941720144/src/main/java/tugas.rar differ diff --git a/PBO_Jobsheet10_1941720144/src/main/java/tugas/Binatang.java b/PBO_Jobsheet10_1941720144/src/main/java/tugas/Binatang.java new file mode 100644 index 0000000..efcf70d --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/tugas/Binatang.java @@ -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(); +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/tugas/Gorilla.java b/PBO_Jobsheet10_1941720144/src/main/java/tugas/Gorilla.java new file mode 100644 index 0000000..f4313f4 --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/tugas/Gorilla.java @@ -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); + } +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/tugas/IHerbivora.java b/PBO_Jobsheet10_1941720144/src/main/java/tugas/IHerbivora.java new file mode 100644 index 0000000..608d897 --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/tugas/IHerbivora.java @@ -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(); +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/tugas/IKarnivora.java b/PBO_Jobsheet10_1941720144/src/main/java/tugas/IKarnivora.java new file mode 100644 index 0000000..f6459db --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/tugas/IKarnivora.java @@ -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(); +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/tugas/Keledai.java b/PBO_Jobsheet10_1941720144/src/main/java/tugas/Keledai.java new file mode 100644 index 0000000..7cd3634 --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/tugas/Keledai.java @@ -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); + } +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/tugas/Main.java b/PBO_Jobsheet10_1941720144/src/main/java/tugas/Main.java new file mode 100644 index 0000000..06b1710 --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/tugas/Main.java @@ -0,0 +1,31 @@ +/* + * 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 Main { + public static void main(String[] args) { + Singa sg=new Singa("Singa",4,"rrraaaaauuuu","Coklat Keemasan"); + Keledai kld=new Keledai("Keledai",4,"ngiihhaa","Abu-abu"); + Gorilla grl=new Gorilla("Gorilla",2,"gwaooo","Hitam ke Abu-Abu an"); + + sg.displayBinatang(); + sg.displayMakan(); + sg.displayData(); + System.out.println(""); + kld.displayBinatang(); + kld.displayMakan(); + kld.displayData(); + System.out.println(""); + grl.displayBinatang(); + grl.displayMakan(); + grl.displayData(); + System.out.println(""); + } +} diff --git a/PBO_Jobsheet10_1941720144/src/main/java/tugas/Singa.java b/PBO_Jobsheet10_1941720144/src/main/java/tugas/Singa.java new file mode 100644 index 0000000..2f91944 --- /dev/null +++ b/PBO_Jobsheet10_1941720144/src/main/java/tugas/Singa.java @@ -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 Singa extends Binatang implements IKarnivora{ + private String suara; + private String warnaBulu; + + public Singa(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("Singa adalah jenis Hewan Karnivora"); + } + + public void displayData(){ + System.out.println("Suara: "+this.suara); + System.out.println("Warna Bulu :"+this.warnaBulu); + } +}