Abstract class _ Interface di java_materi suplement 1 (1).pdf

Nama temp1 temp2 bantunomor bantunomor bantu1nomor

  • No School
  • AA 1
  • 35

This preview shows page 20 - 24 out of 35 pages.

bantu1.Nama = temp1; temp2 = bantu.Nomor; bantu.Nomor= bantu1.Nomor; bantu1.Nomor= temp2; temp3 = bantu.JenisBuku; bantu.JenisBuku = bantu1.JenisBuku; bantu1.JenisBuku = temp3; temp4 = bantu.Buku; bantu.Buku = bantu1.Buku; bantu1.Buku = temp4; temp5 = bantu.Hari1;
Image of page 20

Subscribe to view the full document.

bantu.Hari1 = bantu1.Hari1; bantu1.Hari1 = temp5; } bantu= bantu.next; bantu1=bantu1.next; } } } //____________________________________ public void SortBuku() { String temp1; int temp2; String temp3; String temp4; int temp5; for (int a=0; a<j-1; a++) { NodePerpus bantu= head; NodePerpus bantu1= head.next; for (int b=0; b<j-1; b++) { if (bantu.Buku .compareTo (bantu1.Buku)>0) { temp1 = bantu.Nama; bantu.Nama = bantu1.Nama; bantu1.Nama = temp1; temp2 = bantu.Nomor; bantu.Nomor= bantu1.Nomor; bantu1.Nomor= temp2; temp3 = bantu.JenisBuku; bantu.JenisBuku = bantu1.JenisBuku; bantu1.JenisBuku = temp3; temp4 = bantu.Buku; bantu.Buku = bantu1.Buku; bantu1.Buku = temp4; temp5 = bantu.Hari1; bantu.Hari1 = bantu1.Hari1; bantu1.Hari1 = temp5; } bantu= bantu.next; bantu1=bantu1.next; } } } //____________________________________ public void SortJenisBuku() { String temp1; int temp2; String temp3; String temp4; int temp5; for (int a=0; a<j-1; a++) { NodePerpus bantu= head; NodePerpus bantu1= head.next; for (int b=0; b<j-1; b++) { if (bantu.JenisBuku .compareTo (bantu1.JenisBuku)>0) { temp1 = bantu.Nama;
Image of page 21
bantu.Nama = bantu1.Nama; bantu1.Nama = temp1; temp2 = bantu.Nomor; bantu.Nomor= bantu1.Nomor; bantu1.Nomor= temp2; temp3 = bantu.JenisBuku; bantu.JenisBuku = bantu1.JenisBuku; bantu1.JenisBuku = temp3; temp4 = bantu.Buku; bantu.Buku = bantu1.Buku; bantu1.Buku = temp4; temp5 = bantu.Hari1; bantu.Hari1 = bantu1.Hari1; bantu1.Hari1 = temp5; } bantu= bantu.next; bantu1=bantu1.next; } } } //_________________________________________ public void DisplayList(){ if(head != null){ NodePerpus bantu = head; System.out.println ("DAFTAR PEMINJAM BUKU"); while(bantu != null){ System.out.println ("Nama : "+bantu.Nama); System.out.println ("Nomor : "+bantu.Nomor); System.out.println ("Jenis Buku : "+bantu.JenisBuku); System.out.println ("Buku Yang Di Pinjam : "+bantu.Buku); System.out.println ("Lama Peminjaman : "+bantu.Hari1); bantu = bantu.next; } System.out.print (" "); } else System.out.println ("Data Kosong"); } //____________________________________ } - NodePerpus class NodePerpus{//mendeklarasikan class NodePerpus public String Nama; public String Buku; public String JenisBuku; public int Hari1; public int Nomor; public int Bayar; public NodePerpus next;
Image of page 22

Subscribe to view the full document.

//****************************** public NodePerpus (String Nm, int No, String JB, String Bk, int Hr1, int By){ Nama = Nm; Buku = Bk; Hari1 = Hr1; JenisBuku = JB; Nomor = No; Bayar = By; next = null; } } - Perpus import java.util.Scanner; import java.io.*; class Perpus{//mendeklarasikan class perpus public static void main(String[] args)throws Exception{ Scanner In = new Scanner (System.in); LinkPerpus List = new LinkPerpus(); BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); int n, No, Pil, Pil1, Pilih0, Pilih, Pilih1,Ind, Hr1, By, lambat,No1; char lagi, lagi1; String Nm, JB,JB1, Cari, Nama,Nm1; String Bk,Bk1; NodePerpus Hapus; //---------------------------------------------------------------- - do { System.out.println("\n"); System.out.println ("| KOLEKSI BUKU YANG KAMI SEDIAKAN |"); System.out.println ("+====+==========+==============+============+================+== ================+"); System.out.println ("| NO | 1. Agama | 2. Kamus | 3.
Image of page 23
Image of page 24
  • Fall '19

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern