subject
Business, 18.01.2021 14:00 gingerham1

Suppose a class GroceryBill keeps track of a list of items being purchased at a market: Method/Constructor Description
public GroceryBill(Employee clerk) constructs a GroceryBill object for the given clerk
public void add(Item i) adds i to this bill's total
public double getTotal() returns the cost of these items
public void printReceipt() prints a list of items
GroceryBill objects interact with Item objects. An Item has the following public methods:
Method/Constructor Description
public double getPrice() returns the price for this item
public double getDiscount() returns the discount for this item
For example, a candy bar item might cost 1.35 with a discount of 0.25 for preferred customers, meaning that preferred customers get it for 1.10. (Some items will have no discount, 0.0.) Currently the above classes do not consider discounts. Every item in a bill is charged full price, and item discounts are ignored.
Define a class DiscountBill that extends GroceryBill to compute discounts for preferred customers. The constructor forDiscountBill accepts a parameter for whether the customer should get the discount.
Your class should adjust the amount reported by getTotal for preferred customers. For example, if the total would have been $80but a preferred customer is getting $20 in discounts, then getTotal should report the total as $60 for that customer. You should also keep track of how many items a customer is getting a non-zero discount for and the overall discount, both as a total amount and as a percentage of the original bill. Include the extra methods below that allow a client to ask about the discount:
Method/Constructor Description
public DiscountBill(Employee clerk, boolean preferred) constructs discount bill for given clerk
public int getDiscountCount() returns the number of items that were discounted, if any
public double getDiscountAmount() returns the total discount for this list of items, if any
public double getDiscountPercent() returns the percent of the total discount as a percent of what the total would have been otherwise
If the customer is not a preferred customer the DiscountBill behaves at all times as if there is a total discount of 0.0 and no items have been discounted.

ansver
Answers: 1

Another question on Business

question
Business, 21.06.2019 15:10
Why there has to be two lines in a plane
Answers: 1
question
Business, 22.06.2019 09:50
For each of the following users of financial accounting information and managerial accounting information, specify whether the user would primarily use financial accounting information or managerial accounting information or both: 1. sec examiner 2. bookkeeping department 3. division controller 4. external auditor (public accounting firm) 5. loan officer at the company's bank 6. state tax agency auditor 7. board of directors 8. manager of the service department 9. wall street analyst 10. internal auditor 11. potential investors 12, current stockholders 13. reporter from the wall street journal 14. regional division managers
Answers: 1
question
Business, 22.06.2019 19:30
The owner of firewood to go is considering buying a hydraulic wood splitter which sells for $50,000. he figures it will cost an additional $100 per cord to purchase and split wood with this machine, while he can sell each cord of split wood for $125. if, for this machine, design capacity is 50 cords per day, effective capacity is 40 cords per day, and actual output is expected to be 32 cords per day, what would be its efficiency?
Answers: 1
question
Business, 22.06.2019 20:00
Describe a real or made-up but possible example of a situation where an employee faces a conflict of interest. explain at least two things the company could do to make sure the employee won't be tempted into unethical behavior by that conflict of interest. (3.0 points)
Answers: 3
You know the right answer?
Suppose a class GroceryBill keeps track of a list of items being purchased at a market: Method/Cons...
Questions
question
Computers and Technology, 29.10.2020 17:00
Questions on the website: 13722367