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:30
According to the research in strategic human resources management,answers: firms that are able to use human resource practices to develop socially complex human and organizational resources are able to gain competitive advantage over firms that do not engage in these practices.firms that are able to use human resource practices to develop socially simplistic human and organizational resources are able to gain competitive advantage over firms that do not engage in these practices.firms that are able to use human resource practices to develop socially complex human and organizational resources gain little advantage over firms that do not engage in these practices.firms that are able to use human resource practices to develop socially complex human and organizational resources are at a competitive disadvantage when compared to firms that do not engage in these practices.
Answers: 3
question
Business, 21.06.2019 21:00
In order to minimize project risk which step comes after the step of identifying risks
Answers: 1
question
Business, 21.06.2019 21:30
Price and efficiency variances, journal entries. the schuyler corporation manufactures lamps. it has set up the following standards per finished unit for direct materials and direct manufacturing labor: direct materials: 10 lb. at $4.50 per lb. $45.00 direct manufacturing labor: 0.5 hour at $30 per hour 15.00 the number of finished units budgeted for january 2017 was 10,000; 9,850 units were actually produced. actual results in january 2017 were as follows: direct materials: 98,055 lb. used direct manufacturing labor: 4,900 hours $154,350 assume that there was no beginning inventory of either direct materials or finished units. during the month, materials purchased amounted to 100,000 lb., at a total cost of $465,000. input price variances are isolated upon purchase. input-efficiency variances are isolated at the time of usage. 1. compute the january 2017 price and efficiency variances of direct materials and direct manufacturing labor. 2. prepare journal entries to record the variances in requirement 1. 3. comment on the january 2017 price and efficiency variances of schuyler corporation. 4. why might schuyler calculate direct materials price variances and direct materials efficiency variances with reference to different points in time
Answers: 2
question
Business, 22.06.2019 01:30
Someone knows the answer i need in the exam
Answers: 2
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.03.2021 14:00
question
Mathematics, 29.03.2021 14:00
question
Mathematics, 29.03.2021 14:00
question
Health, 29.03.2021 14:00
question
Mathematics, 29.03.2021 14:00
Questions on the website: 13722365