document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.  
  2. /**
  3. * Write a description of class struk here.
  4. *
  5. * @author (your name)
  6. * @version (a version number or a date)
  7. */
  8. import java.util.Date;
  9. import java.text.DateFormat;
  10. import java.text.SimpleDateFormat;
  11. public class struk
  12. {
  13. int balance;
  14. int price;
  15. private Date date;
  16. private DateFormat dateFormat;
  17. public struk(int Balance, int Price)
  18. {
  19. balance = Balance;
  20. price = Price;
  21. dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
  22. date = new Date();
  23. }
  24. public void print()
  25. {
  26. System.out.println("###############################################");
  27. System.out.println("##########Surabaya-MalangToll Gate#############");
  28. System.out.println("##Tanggal Transaksi: " + dateFormat.format(date));
  29. System.out.println("##Biaya Tol: " + price);
  30. System.out.println("##Sisa Saldo: " + balance);
  31. System.out.println("###############################################");
  32.  
  33. }
  34. }
');