Question: At this level, your program will have some basic classes with specifications as below. You may need to define methods wherever appropriate to support these

At this level, your program will have some basic classes with specifications as below. You may need to define methods wherever appropriate to support these classes. At the end of the PASS level, your program should be able to run with a menu described in the class Operations. Customers: 1. Class Customer, Each customer has a unique ID, unique name (a name will only contain alphabet characters).Each customer also has some reward points. You are required to write the class named, Customer to support the following: i. Attributes ID, name, and reward, ii. Constructor takes the values of ID, name, and reward as arguments iii. Appropriate getter methods for the attributes of this class iv. A method get_reward which should be an empty super method v. A method get_discount which should be an empty super method vi. A method update_reward which should be an empty super method vii. A method display_info which should be an empty super method 2. Class BasicCustomer
All Basic customers have a flat reward rate when making a purchase (i.e., all Basic customers have the same reward rate). By default, the flat reward rate is 100%. The class BasicCustomer should have the following components: i. An attribute for the reward rate ii. Constructor takes the appropriate parameters/arguments.iii. Appropriate getter methods for the attributes of this class iv. A method get_reward which takes the total cost and returns the reward. Note, the reward is always rounded. For example, when the total cost is 14.8 and the reward rate is 100%, then the method will returns the reward which is round(14.8 x 100%)=15. v. A method update_reward which takes a value and increase the attribute reward with that value.
vi. A method display_info that prints the values of the BasicCustomer attributes. vii. A method set_reward_rate to adjust the reward rate. This method affects all Basic
customers. 3. Class VIPCustomer A VIP customer not just receives the reward but also gets a discount for the purchase. The reward rate is the same for all VIP customers and has the default value of 100%. On the other hand, the discount rate is different among VIP customers. If not specified, the discount rate is set as 8%. Note that the reward is computed after the discount. For example, with a reward rate of 100%
and discount rate of 8%, if a VIP customer makes a purchase with the original total cost of 30$,then discount will be 30 x 8%=2.4$, the total cost after the discount is 27.6$, and thus, the reward is round(27.6 x 100%)=28.The class VIPCustomer should have the following components: i. Appropriate attributes to support the reward rate and discount rate ii. Constructor takes the appropriate parameters/arguments iii. Appropriate getter methods for the attributes of this class iv. A method get_discount which takes the total cost and returns the discount offered v. A method get_reward which takes the total cost and returns the reward vi. A method update_reward which takes a value and increase the attribute reward with that value.
vii. A method display_info that prints the values of the VIPCustomer attributes viii. A method set_reward_rate to adjust the reward rate. This method affects all VIP
customers ix. A method set_discount_rate to adjust the discount rate of each individual VIP customer Products: 4. Class Product This class is to keep track of information on different products that the pharmacy offers. This class supports the following information: ID: a unique identifier of the product name: the name of the product (you can assume the product names are unique and they do not include any digit) price: the unit price of the product A method display_info that prints the values of the Product attributes Extra attributes and methods if you want to define

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!