Business
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.

answer
Answers: 1

Other questions on the subject: Business

image
Business, 21.06.2019 19:30, qiuedhg
Consumer surplus is: the difference between the price of a product and what consumers were willing to pay for the product. the difference between the discounted price of a product and its retail price. the difference between the price paid by consumers and the price required of producers. the difference between the price of a product and consumers' valuation of the last unit of the product purchased.
Answers: 2
image
Business, 22.06.2019 19:40, mahoganyking16
Chang corp. has $375,000 of assets, and it uses only common equity capital (zero debt). its sales for the last year were $595,000, and its net income was $25,000. stockholders recently voted in a new management team that has promised to lower costs and get the return on equity up to 15.0%. what profit margin would the firm need in order to achieve the 15% roe, holding everything else constant? a. 9.45%b. 9.93%c. 10.42%d. 10.94%e. 11.49%
Answers: 2
image
Business, 22.06.2019 19:40, silasjob09
The martinez legal firm (mlf) recently acquired a smaller competitor, miller and associates, which specializes in issues not previously covered by mlf, such as land use and intellectual property cases. given the increase in the firm's size and complexity, it is likely that its internal transaction costs willa. decrease. b. increase. c. become external transaction costs. d. be eliminated.
Answers: 3
image
Business, 22.06.2019 22:00, toxsicity
Which of the following statements about nonverbal communication is most accurate? a. the meanings of some gestures can vary among cultures b. the way an e-mail, letter, memo, or report looks can have either a positive or a negative effect on a receiver c. the manner in which we structure and use time can reveal our personalities and attitudes d. all statements are accurate
Answers: 1
Do you know the correct answer?
Suppose a class GroceryBill keeps track of a list of items being purchased at a market: Method/Cons...

Questions in other subjects: