A supermarket is interested in creating an application that will enable it to offer discounts to its customers. You have been contracted based on your C# knowledge and as such you are required to create an Item class that will form the basis of the application. The information to be represented in the class is given below.
a) Create an appropriate default constructor for the class.
b) The class should be able to store the name of the item as well as its price.
c) The class should also contain an attribute that will represent the category of discount to be applied to the item. Categories range from ‘A’ to ‘C’.
d) Items in category A attract a 25% discount, while items in categories B and C attract 10% and 5% respectively.
e) Additionally, customers are also granted discount based on the quantity of items purchased. Quantities ranging from 10 – 15 will attract a 2% discount, quantities ranging from 16 – 25 will attract a 3% discount and quantities above 25 will attract a 7% discount.
f
Comments
Leave a comment