Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Customers: 1 . Class Customer Each customer has a unique ID , unique name ( a name will only contain alphabet characters ) . Each
Customers: Class CustomerEach 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 rewardii Constructor takes the values of ID name, and reward as argumentsiii Appropriate getter methods for the attributes of this classiv A method getreward which should be an empty super methodv A method getdiscount which should be an empty super methodvi A method updatereward which should be an empty super methodvii A method displayinfo which should be an empty super method Class BasicCustomerAll Basic customers have a flat reward rate when making a purchase ie all Basic customers have the same reward rate By default, the flat reward rate is The class BasicCustomer should have the following components:i An attribute for the reward rateii Constructor takes the appropriate parametersargumentsiii Appropriate getter methods for the attributes of this classiv A method getreward which takes the total cost and returns the reward. Note, the reward is always rounded. For example, when the total cost is and the reward rate is then the method will returns the reward which is round x v A method updatereward which takes a value and increase the attribute reward with that value.vi A method displayinfo that prints the values of the BasicCustomer attributes.vii A method setrewardrate to adjust the reward rate. This method affects all Basic customers. Class VIPCustomerA 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 On the other hand, the discount rate is different among VIP customers. If not specified, the discount rate is set as Note that the reward is computed after the discount. For example, with a reward rate of and discount rate of if a VIP customer makes a purchase with the original total cost of $ then discount will be x $ the total cost after the discount is $ and thus, the reward is round x The class VIPCustomer should have the following components:i Appropriate attributes to support the reward rate and discount ratePage of RMIT Classification: Trustedii Constructor takes the appropriate parametersargumentsiii Appropriate getter methods for the attributes of this classiv A method getdiscount which takes the total cost and returns the discount offeredv A method getreward which takes the total cost and returns the rewardvi A method updatereward which takes a value and increase the attribute reward with that value.vii A method displayinfo that prints the values of the VIPCustomer attributesviii A method setrewardrate to adjust the reward rate. This method affects all VIP customersix A method setdiscountrate to adjust the discount rate of each individual VIP customerProducts: Class ProductThis 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 displayinfo that prints the values of the Product attributes Extra attributes and methods if you want to defineOrders Class OrderThis class is to store a customer's purchase information. This class supports the following information of an order: customer: the one who makes the purchase can be a Basic or VIP customer You need to thinkanalyse carefully if this should be an ID name, or something else. product: the product of the purchase. You need to thinkanalyse carefully if this should be an ID name, or something else. quantity: the quantity of the product ordered by the customer A method computecost that returns the original total cost the cost before the discount the discount, the final total cost the cost after the discount and the reward. For example, if the original total cost of an order of the customer Tom VIP customer with reward rate of and discount rate of is then this method will return Extra attributes and methods if you want to define.Records Class RecordsThis class is the central data repository of your program. It supports the following information: a list of existing customers you need to think what you should store in this list customer ID customer name, or something else? a list of existing products you need to think about what you should store in this list product ID product name, or something else?Page of RMIT Classification: Trusted This class has a method named readcustomers. This method takes in a file name and then read and add
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started