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 20:20
If the government is required to balance the budget and the economy falls into a recession, which of the actions is a feasible policy response? cut taxes to encourage consumer spending invest in infrastructure increase government spending to stimulate the economy cut spending equal to the reduction in tax revenue what is a likely consequence of this policy? unemployment falls due to the economic stimulus. the negative consequences of the recession are magnified. consumer spending increases due to their ability to keep more of their after-tax income. there is hyperinflation due to an increase in aggregate demand.
Answers: 3
question
Business, 22.06.2019 01:40
Suppose general motors demands labor according to the labor demand function ํ‘คํ‘ค= 40โˆ’0. 5ํธํธ, where ํ‘คํ‘ค is the hourly wage and ํธํธ is the number of employees. the united auto workers union has a utility function given by ํ‘ˆํ‘ˆ=ํ‘Šํ‘Šโˆ—ํธํธ. a.in 1984, the united auto workers union started negotiations with general motors by assuming that they were a monopoly union. find the wage and employment demands that the united auto workers union would have demanded before any bargaining began. b.if general motors and the united auto workers union both had excellent bargaining representatives, would this be the final labor contract? if not, then explain in words and graphically where they would end up after the bargaining process.
Answers: 1
question
Business, 22.06.2019 16:00
In macroeconomics, to study the aggregate means to study blank
Answers: 1
question
Business, 22.06.2019 20:00
Question 6 of 102 pointswhich situation shows a constant rate of change? oa. the number of tickets sold compared with the number of minutesbefore a football gameob. the height of a bird over timeoc. the cost of a bunch of grapes compared with its weightod. the outside temperature compared with the time of day
Answers: 1
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
Social Studies, 11.03.2020 12:22
question
Mathematics, 11.03.2020 12:22
question
Mathematics, 11.03.2020 12:28
question
Chemistry, 11.03.2020 12:29
Questions on the website: 13722360