Kode Tiket Konser
/**
* Class Tiket Konser
*/
import java.util.Scanner;
public class TiketReeva
{
private int harga_;
private int kode_konser_;
private int jumlah_tiket_;
private String nama_konser_;
private String tanggal_konser_;
Scanner scan = new Scanner(System.in);
public void beliTiketReeva()
{
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)");
kode_konser_= scan.nextInt();
switch(kode_konser_)
{
case 1:
nama_konser_ = "REEVA";
harga_ = 60000;
break;
case 2:
nama_konser_ = "PARADIGM";
harga_ = 65000;
break;
case 3:
nama_konser_ = "CIVEX";
harga_ = 60000;
break;
}
System.out.println("Masukkan Jumlah Tiket");
jumlah_tiket_= scan.nextInt();
hitungHarga();
printNota();
}
public void hitungHarga()
{
harga_ = harga_ * jumlah_tiket_;
}
public void printNota()
{
System.out.println("\n");
System.out.println("I-Kios");
System.out.println("Tiket Konser");
System.out.println("Nama Konser : " + nama_konser_);
System.out.println("Harga : " + harga_);
System.out.println("\n");
}
}
Komentar
Posting Komentar