Advertisement
belamarsha

Untitled

Oct 24th, 2019
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class TiketKonser
  3. {
  4. private int harga;
  5. private int kodeKonser;
  6. private int jumlah;
  7. private String namaKonser;
  8. private String tanggal;
  9. Scanner scan = new Scanner(System.in);
  10.  
  11. public void beliTiketKonser()
  12. {
  13. System.out.println("Pilih Konser");
  14. System.out.println("");
  15. System.out.println("1. REEVA (60000)");
  16. System.out.println("2. PARADIGM (65000)");
  17. System.out.println("3. CIVEX (60000)");
  18.  
  19. kodeKonser= scan.nextInt();
  20.  
  21. switch(kodeKonser)
  22. {
  23. case 1:
  24. namaKonser = "REEVA";
  25. harga = 60000;
  26. break;
  27. case 2:
  28. namaKonser = "PARADIGM";
  29. harga = 65000;
  30. break;
  31. case 3:
  32. namaKonser = "CIVEX";
  33. harga = 60000;
  34. break;
  35. }
  36.  
  37. System.out.println("Masukkan Jumlah Tiket");
  38. jumlah= scan.nextInt();
  39. hitungHarga();
  40. printNota();
  41. }
  42.  
  43. public void hitungHarga()
  44. {
  45. harga = harga * jumlah;
  46. }
  47.  
  48. public void printNota()
  49. {
  50. System.out.println("\n");
  51. System.out.println("I-Kios");
  52. System.out.println("Tiket Konser");
  53. System.out.println("Nama Konser : " + namaKonser);
  54. System.out.println("Harga : " + harga);
  55. System.out.println("\n");
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement