Suppose you own a soft drink distributorship that sells Coca-Cola, Pepsi, Sprite, and Fanta. You are required to write a menu-driven program to handle the transactions done. The menu should display the following options:
1 – Order Soda
2 – Make Payment
3 – Quit
If the user chooses option 1, the program should display the list of soda available together with the corresponding prices. The user may choose more than one soda to buy. For each soda, request a quantity to buy. Display the running total after each soda has been chosen and prompt the user whether to buy more soda or finish ordering. If no more ordering is made, the program should display the menu again. If the user chooses option 2, display the total to be paid, prompt for the amount to be given by the user, display the balance need to be returned back to the user, and re-initialize all variables to zero. If no order has been made when this option is chosen, the program should display a message saying “No order made”. Option 3 should allow the program to terminate.
Below is my code but I do not know what's wrong with my calculation, it didn't display the correct drink total and total. I hope to get some help.