After complete the below part of the sales program, I need to add function to do the calculation of the sales.
For example, after i obtain the input of product code and quantity of sales from user, i want to update the quantity in Product class in the code.
If the user input c1 for product code and quantity 8 for quantity sold. Then i should have a function to update the c1.quantitySold.
And after the user input the first product, the user still want to continue input more products, how can i update the respective quantitySold.
After that, I also need to calculate the total amount due.
Pls see the below sample screen that what i mentioned, the sample outcome should look something like this: Item sold:- Enter product code:c1 Enter quantity:1 More items[Y/N]?:Y Enter product code:p1 Enter quantity:5 More items[Y/N]?:N
Actually, in my SalesMade function, i intend to update the quantity sold of certain product. And after one product sale is updated when user want to update more sale, the totalAmountDue is sum of qtySold.