4-OrangeLime: This class inherits from Lemon class that you just created above. This “fruit” is really a special addition of the fruit shop where they use some lemons to create special juice mixes. The constructor of this class will take the price per lemon (same as above for the Lemon class), how many juices, and the labor cost. Each juice will have a predefined number of lemons in it. Use the LEMONS_IN_A_JUICE constant in the Consts.java file to get that number. The getCost() method will return the cost of all lemons in the juices order plus a labor cost that was given in the constructor. The labor cost is for all the juices and not for each individual juice. So if there is an order of 4 juices, each juice takes 6 lemons, and each lemon costs 0.4 QR. The labor cost is 5 QR, then the cost is (4 * 6 * 0.4) + 5 QR which must be returned by the getCost() function.
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-59372.pdf
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment