Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I don't know if this is allowed or not but please help Do the following . Create an abstract class DiscountPolicy. It should have a

I don't know if this is allowed or not but please help image text in transcribed
Do the following . Create an abstract class DiscountPolicy. It should have a single abstract method computeDiscount that will return the discount for the purchase of a given number of a single item. The method has two parameters, count and itemCost. Derive a class Bulk Discount from DiscountPolicy. It should have a constructor that has two parameters, minimum and percent. It should define the method computeDiscount so that if the quantity purchased of an item is more than minimum, the discount is percent percent. Derive a class BuyNitemsGetOneFree from Discount Policy. It should have a constructor that has a single parameter n. In addition, the class should define the method computeDiscount so that every nth item is free. For example, the following table gives the discount for the purchase of various counts of an item that costs $10, when nis 3: UM Blogrom Count 12 3 4 5 6 7 Discount 00 10 10 10 20 20 Discount Policy computerscount coure irrecon fon)How Buy One Bund Byen Dent ce

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

4. Repeat the last exercise using the data for group 2.

Answered: 1 week ago