Jjjjjjjj
/** * Imprime um ticket azul */ public void printTicketAzul() { int amountLeftToPay = priceAzul - balance; if(amountLeftToPay <= 0) { // Simulate the printing of a ticket. System.out.println("##################"); System.out.println("# The BlueJ Line"); System.out.println("# Blue Ticket"); System.out.println("# " + priceAzul + " cents."); System.out.println("##################"); System.out.println();
// Update the total collected with the price. total += priceAzul; // Reduce the balance by the prince. balance = balance - priceAzul; } else { System.out.println("You must insert at least: " + (amountLeftToPay) + " more cents."); } }
/** * Imprime um ticket amarelo */ public void printTicketAmarelo() { int amountLeftToPay = priceAmarelo - balance; if(amountLeftToPay <= 0) { // Simulate the printing of a ticket. System.out.println("##################"); System.out.println("# The BlueJ Line"); System.out.println("# Yellow Ticket"); System.out.println("# " + priceAmarelo + " cents."); System.out.println("##################"); System.out.println();
// Update the total collected with the price. total += priceAmarelo; // Reduce the balance by the prince. balance = balance - priceAmarelo; } else { System.out.println("You must insert at least: " + (amountLeftToPay) + " more cents."); } } /** * Imprime um ticket