Write a JAVA program 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 thenumbers bought foreach 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. Also, display this 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 append new data to the end of the output file. Make sure you explain and justify every line of your code using internal documentation .
Write a JAVA program 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 thenumbers bought foreach 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. Also, display this 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 append new data to the end of the output file. Make sure you explain and justify every line of your code using internal documentation .
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images