Your AddProduct reads user input and writes to a file. If you want to continue that path:
ViewSalesPerProduct reads file(s) and prints values.
PurchaseProduct reads file(s), reads user input, and writes file.
EditProductPrice reads file, reads user input, and writes file.
Sounds a bit inconvenient.
- Classes and Data Abstraction Usage |
I see no use of classes in your code.
How about this:
1. Program starts by reading files into memory. (Use std::vector of class objects.)
2. User selects operations that modify the in memory copy.
3. Program updates files at the very end, after the user has chosen to quit.