-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPengguna.java
More file actions
35 lines (29 loc) · 943 Bytes
/
Pengguna.java
File metadata and controls
35 lines (29 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public abstract class Pengguna implements Mendengarkan{
static int idPengguna = 1;
private int kodePelanggan;
protected String nama;
protected DaftarLaguPengguna playlist = new DaftarLaguPengguna();
protected String statusKeanggotaan;
Pengguna(String nama){
this.kodePelanggan = 2340 + idPengguna;
idPengguna++;
this.nama = nama;
}
public String toString(){
return
"Kode Pelanggan : "
+ this.kodePelanggan + " \n" +
"Nama Pelanggan : " + this.nama + " \n" +
"Status Keanggotaan : " + this.statusKeanggotaan;
}
public void ambilListLagu() {
if(playlist == null){
System.out.println("Belum ada lagu yang ditambahkan");
return;
}
playlist.tampilkanDaftar();
}
public void tambahPlaylist(String m){
playlist.tambahMusik(m, this.statusKeanggotaan);
}
}