Exercise 2.10

Cover Book - (Objects First with Java_ A Practical Introduction Using BlueJ 6th Edition) David J. Barnes & Michael Kölling - Objects First with Java_ A Practical Introduction Using BlueJ. 6-Pearson (2016)

The fields are

private int price;
private int balance;
private int total;

The constructor head is

public TicketMachine(int cost)

The method heads are

public int getPrice()
public int getBalance()
public void insdertMoney()
public void printTicket()

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.