Write Purchase class that will keep track of the purchases made at a store. Assuming that the
Question:
Write Purchase class that will keep track of the purchases made at a store. Assuming that the information of all purchases are stored in a text file, you have to ask the user to enter the name of the text file that contains all the item's names, the corresponding prices, and the numbers bought for each item. After the file has been read, remember to close the file. Compute the cost of the purchase (number bought times price), and write all this data to another different output text file. After creating the Purchase class, write a client program that can use the class. You have to include the following in your client class. The client class needs to be able to display all the information and the current total cost on the screen. After all items have been entered, write the total cost to both the screen and the output file. Since we want to remember all purchases made, you should have a way to append all new data to the end of the output file. Make sure you explain and justify every line of your code using internal documentation to get full mark. Provide pre-conditions and post-conditions. Clearly state any object-oriented programming concepts that you have used to design the Purchase class and the client class to encourage code reuse, abstraction and encapsulation.
Mark distributions:
Correct code and implementation provided (35 marks)
Clear internal documentation provided (10 marks)
Correct explanation of the OOP concepts used (10 marks)
Accounting Information Systems
ISBN: 978-1133935940
10th edition
Authors: Ulric J. Gelinas, Richard B. Dull