write a program that calculates supermarket goods include sales
Anonymous
I offered several answers: 1. create sorted array with all the product for example : B,B,B,C,C,F,F then calculate price by number of repetitions of each product 2. second option: create map any time a product arrived to cashier i add it to the stack and update the price, if there is some sale so i remove from stack the products which are on sale (for example: if its 1 for 20, but 2 for 30. then when the stack has 1 item which cost 20, and another arrived i removed him and insert one item which equals 30 )
Check out your Company Bowl for anonymous work chats.