i want to make my program compute for the change of the customer.
for example if the total amout due is $90 and the customer paid $100. the program should answer $10. if the customer paid less the program should tell invalid.
After you calculate the tax on line 62, you can ask the user to enter how much they want to pay (use the standard input stream cin). To handle invalid input, you could use cin.fail() as described in this thread: http://www.cplusplus.com/forum/beginner/2957/
Once the input has been verified and you have your amount, you'd need a conditional statement to ensure that the payment amount is greater than or equal to the total with tax. If it isn't, handle it how you want (i.e. print invalid). If it is, calculate the change as the difference between the payment amount and the total, and print it or something.
if i am right cin fail only tells if you input the value correctly. but does not actually subtract the cash given by the customer and the actual cost. to tell you frankly i don't understand that codes quite well. i am just a noob here in c++ prgoramming
edit:
I would delete this post out of embarrassment, but it is considered bad form.
Please ignore -- I misread your question and confused it with another similar post.