Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class TiketKonser
- {
- private int harga;
- private int kodeKonser;
- private int jumlah;
- private String namaKonser;
- private String tanggal;
- Scanner scan = new Scanner(System.in);
- public void beliTiketKonser()
- {
- System.out.println("Pilih Konser");
- System.out.println("");
- System.out.println("1. REEVA (60000)");
- System.out.println("2. PARADIGM (65000)");
- System.out.println("3. CIVEX (60000)");
- kodeKonser= scan.nextInt();
- switch(kodeKonser)
- {
- case 1:
- namaKonser = "REEVA";
- harga = 60000;
- break;
- case 2:
- namaKonser = "PARADIGM";
- harga = 65000;
- break;
- case 3:
- namaKonser = "CIVEX";
- harga = 60000;
- break;
- }
- System.out.println("Masukkan Jumlah Tiket");
- jumlah= scan.nextInt();
- hitungHarga();
- printNota();
- }
- public void hitungHarga()
- {
- harga = harga * jumlah;
- }
- public void printNota()
- {
- System.out.println("\n");
- System.out.println("I-Kios");
- System.out.println("Tiket Konser");
- System.out.println("Nama Konser : " + namaKonser);
- System.out.println("Harga : " + harga);
- System.out.println("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement