Class Ticket Machine
Nama : Maulana Akbar NRP : 5025231259 Kelas : PBO (A) Membuat program ticket machine menggunakan BlueJ Source code /** * TicketMachine models a ticket machine that issues * flat-fare tickets. * The price of a ticket is specified via the constructor. * Instances will check to ensure that a user only enters * sensible amounts of money, and will only print a ticket * if enough money has been input. * @author David J. Barnes and Michael Kölling * @version 2011.07.31 */ public class TicketMachine { // The price of a ticket from this machine. private int price; // The amount of money entered by a customer so far. private int balance; // The total amount of money collected by this machine. private int total; /** * Create a machine that issues tickets of the given price. */ public TicketMachine ( int cost) { price = cost; balance = 0 ; total = 0 ; } /** * Return the price of ...