Microsoft Word - Online Store.docx 1. An online grocery store requires a centralized management software. Consider you are working in a software company and responsible for a small part of this...

please refer to file and do question 1 a-e


Microsoft Word - Online Store.docx 1. An online grocery store requires a centralized management software. Consider you are working in a software company and responsible for a small part of this project with the following requirements. (35 marks) Data For every customer, there is a text file that keeps the shopping information of that customer for one month. For example, customer1.txt and customer2.txt below show recent shopping information of these customers. There is also a separate text file, customerInfo.txt, that keeps the information of customers to send news about the promotions and discounts. Finally, there is a text file (tax.txt) that keeps the most up-to- date tax information of every province. customer1.txt Item Unit Price Quantity Carrot $2.3 2 Salmon $21.22 1 Ice cream $3.2 3 customer2.txt Item Unit Price Quantity Meat $8.1 0.5 Vegetable $5 1 Bread $2.5 2 tax.txt Province PST GST Alberta 7% 5% British Columbia 12% 10% Quebec 7% 7% Ontario 10% 8% customerInfo.txt Customer Province Name Phone #1 Quebec James Martin 123432 #2 Ontario Rocky Blonde 123455 #3 Alberta Ali Khan 234543 Classes and Methods a. Develop a Customer class. Provide necessary instance variables and methods, including accessors and mutators to read and change Province, Name, and Phone. Build two constructors, one default and another to receive Province, Name, and Phone. (5 marks) b. Develop a Store class. Create three objects from Customer class and pass required information to their constructors. You need to read customerInfo.txt. (5 marks) c. Develop a method taxCompute() that calculates the total tax for each customer. The total tax is the sum of GST and PST tax. For example, if the total shopping of a customer in Alberta is $23, GST is $1.15 and PST is $1.61, so the total tax of that customer is $2.76. You need to read customer text files for each customer to know the shopping information for them. Note the name of text files containing information about each customer; your method should be general such that it can automatically read all the files of customers in the directory. Also, you need to read tax.txt to have the latest tax information. Use ArrayList to keep the shopping information for every customer. (10 marks) d. Develop a method promotCompute() that keeps track of shopping of customers and send a notice to that customer if total shopping is higher than a threshold. The threshold here is $200. The notice is in the form of changing a Boolean variable in the Customer class, like receivedGift = True. Method promotCompute() is called every week in the Store class. Each customer may receive several gifts, provided their weekly purchase is a multiple of 200. Devise a mechanism to handle this as well. (8 marks) e. Develop a method toString() for the Store class that prints the monthly bill for each customer. The format of printing should look like: (7 marks) No. items: 10 Purchase Amount: $200.00 GST: $10.00 PST: $14.00 Total tax: $24.00 Total Amount: $224.00 No. gifts: 1
Apr 22, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here