Your employer has asked you to write a program to manage the company’s daily Sales and Purchases. The program needs to give the user the option of entering details of a Sale or details of a Purchase.
The user will need to log into the system to access the transaction menu. When the Sales option is selected from the transaction menu the user will be required to enter the sales price and sales costs (it should not be possible to enter negative figures for either the sales price or sales costs). The program must then calculate and display the net sales price (sales price – sales costs). Following that the user will be given the option of entering another sale or returning to the main menu. The program will keep a running total of the net sales prices.
When the Purchases option is selected the user will be required to enter the purchase price and the transaction costs (Again, there should be some validation to ensure that negative numbers are not entered). The program must then calculate and display the overall purchase price (purchase price + transaction costs). Following that the user will be given the option of entering another purchase or returning to the main menu. The program will keep a running total of the overall purchase costs.
When the user selects to quit the program a final report must be displayed showing the total sales and the total purchases and the overall balance of the cash flow for the day. You should include any further information in the report that you think useful, for example, the average sales price, the average purchase price, a complete listing of all transactions, the highest sales price or the highest purchase price.
An added feature that you also need to implement is an onscreen help system, to explain to the user how to use the program
Your program should contain at least one sub procedure which uses parameters.
It sounds like a pretty straight-forward second-semester assignment. Where are you stuck?
I'd make functions to do the following:
- login (so that main() can accept/reject you)
- transaction menu
- input a non-negative number
- enter Sales
- enter Purchases
- display daily transaction report
- help
You might also want to consider whether or not your professor expects you to maintain a file with all transactions. If so, you'll also want functions for:
- load transaction history from file
- save transaction history to file
Also, a bit of advice. For get doing stuff like clearing the screen and fancy input buffering, etc. Stick to the assignment.