Question: Java Consider the following abstract class DiscountBasic: abstract class DiscountBasic public abstract double getDiscount (int count, double itemCost); It have a single abstract method getDiscount

Java Consider the following abstract class DiscountBasic: abstract class DiscountBasic public abstractJava

Consider the following abstract class DiscountBasic: abstract class DiscountBasic public abstract double getDiscount (int count, double itemCost); It have a single abstract method getDiscount () that retums the discount for the purchase of a given number of a single item. Derive a class BulkDiscount from DiscountBasic. It should have a constructor that has two parameters, minimum and percentOff. It should override the method getDiscount () so that if the quantity purchased of an item is more than minimum, then calculate the discount amount using the percentoff percentage. For example: if a customer has 5% off on 10 or more items and the total of purchase is 25 items at $6 each, then the discount is $75. (ie, 25 6 5/100.0) Write the BulkDiscount class in the answer box below. Note: you can assume that the DiscountBasic class has been done for you. Note to this task because you will be extending it step by step in subsequent tasks For example Test keep a copy of your solution Result BulkDiscount bulkl new BulkDiscount (10, 5.0) System . out.println("5% off on 10 or more items "); System.out.println(bulkl.getDiscount (5, 5.0)) 5% off on 10 or more items ee BulkDiscount bulk1 new BulkDiscount (10, 5.0); System.out.println("5% off on 10 or more items "); System.out.println(bulkl.getDiscount (25, 6.0)) 5% off on 10 or more items 7.5

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!