Answer to Question #59372 in Java | JSP | JSF for Nithya
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.