Question: Using Java code how would I create an interface Discount Policy. Create an interface DiscountPolicy. It should have a single method computeDiscount thatwill return the

Using Java code how would I create an interface Discount Policy. Create an interface DiscountPolicy. It should have a single method computeDiscount thatwill return the discount for the purchase of a given number of a single item. The methodhas two parameters, count and itemCost.Derive a class BulkDiscount from DiscountPolicy. It should have a constructor that hastwo parameters minimum and percent. It should define the method computeDiscount sothat if the quantity purchased of an item is more than minimum, the discount is percentpercent.Create a BuyXGetOneFree class that implements the interface DiscountPolicy. This should use a method to set the X value and give the discount value for that amount of items. This criterion is linked to a Learning OutcomeInterface for Discount PolicyThis criterion is linked to a Learning OutcomeMethod for InterfaceMust contain appropriate parameters and return a doubleThis criterion is linked to a Learning OutcomeCreate Bulk Discount ClassThis criterion is linked to a Learning OutcomeCorrect class variablesThis criterion is linked to a Learning OutcomeEncapsulatedThis criterion is linked to a Learning OutcomeCompute Discount Method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!