You will also need to create a Cashier.java file in package qa.edu.qu.cmps251.hw3 (not in the .model subpackage) that implements this interface. The cashier must have an ArrayList of fruits, a method called getTotalCost() will return the cost of all the fruit objects in the list, and getTotalTax() will return only the total taxes of the fruits in the list. You must use the constant TAX_RATE in the Consts.java file to get that rate and calculate the taxes properly. The constructor of this class must take the shop name. This shop name will be printed in the receipt eventually.
Pay attention that you must round your prices to the nearest 2 digit decimal points in both of these methods.
You must also override toString() method and return a user-friendly receipt of all the items in the basket in this cashier.
The answer to the question is available in the PDF file https://assignmentexpert.com/https://assignmentexpert.com/homework-answers/programming-answer-59442.pdf
Comments
Leave a comment