Ticket Machine
Ticket Machine Ticket Machine adalah mesin yang melayani penjualan tiket kereta api. Di dalamnya terdapat program yang mengatur harga tiket, kembalian uang, dan mencetak receipt sebagai bukti pembelian. Berikut adalah programnya : 1. Source Code Ticket Machine /** * Write a description of class TicketMachine here. * * @author (Yuki Yanuar Ratna) * @version (17 Sept 2018) */ 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. * Note that the price must be greater than zero, and there * are no checks to ensure this. */ public TicketMachine(int ticketCost) { price = ticketCost; balance = 0; total = ...













Komentar
Posting Komentar