Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TestCashier
- {
- public static void main(String[] arg)
- {
- Cashier c = new Cashier();
- String name = GetData.getWord(“Enter name of item”);
- double price = GetData.getDouble(“Enter price of item”);
- c.add(name, price);
- name = GetData.getWord(“Enter name of item”);
- price = GetData.getDouble(“Enter price of item”);
- c.add(name, price);
- // Add a two more entries of your own
- // Now average the price of the items
- c.average();
- // Make payment
- double amount = GetData.getDouble(“Enter amount of money for payment”);
- c.tendered(amount); // For example twenty dollars were tendered
- c.makeChange();
- generateReceipt(c);
- }
- static void generateReceipt(Cahier c)
- {
- // Write the necessary code that will generate a customer’s receipt.
- // The output must be displayed in a scrollable pane
- }
- }
Add Comment
Please, Sign In to add comment