Problem will be triggered when user completed check out procedure. The customer's cart will not be emptied after check out. ================================================================================== ---Welcome to Checkout System, ON9.--- Input commands for further management: Input (1) for Checkout Input (2) for refund Input (3) for exit 1 No Description Quantity Price($) 1 candies 100 3000.0 2 Calcium Blocks 100 15000.0 3 Coke 560 5600.0 Please input (0) for proceed to checkout Please input (1) for remove products Please input (2) for modify quantities of products Please input (3) to cancel the checkout process 0 The total amount is: $22420.00 Please Input the amount of dollars that the customers paid 22420 Total changes is $0.00 Input commands for further management: Input (1) for Checkout Input (2) for refund Input (3) for exit 1 No Description Quantity Price($) 1 candies 100 3000.0 2 Calcium Blocks 100 15000.0 3 Coke 560 5600.0 Please input (0) for proceed to checkout Please input (1) for remove products Please input (2) for modify quantities of products Please input (3) to cancel the checkout process
The problem has been solved by adding a void in package user. ================================================================================ public void removeProductInCart(int digit) { cart.remove(digit); } ================================================================================ Please input your Worker ID for logging in the system... 1 Please input your Member ID for logging in the system... 1234 ---Welcome to Morx Supermarket--- ---To continue, please proceed your actions--- Input (1) for accessing Inventory System Input (2) for accessing Checkout System Input (3) for accessing Sales System Input (4) for accessing Membership System Input (5) for switching member Input (6) to exit 2 ---Welcome to Checkout System, ON9.--- Input commands for further management: Input (1) for Checkout Input (2) for refund Input (3) for exit 1 No Description Quantity Price($) 1 candies 100 3000.0 2 Calcium Blocks 100 15000.0 3 Coke 560 5600.0 Please input (0) for proceed to checkout Please input (1) for remove products Please input (2) for modify quantities of products Please input (3) to cancel the checkout process 0 The total amount is: $22420.00 Please Input the amount of dollars that the customers paid 22420 Total changes is $0.00 Input commands for further management: Input (1) for Checkout Input (2) for refund Input (3) for exit 3 Exiting... ---To continue, please proceed your actions--- Input (1) for accessing Inventory System Input (2) for accessing Checkout System Input (3) for accessing Sales System Input (4) for accessing Membership System Input (5) for switching member Input (6) to exit 2 ---Welcome to Checkout System, ON9.--- Input commands for further management: Input (1) for Checkout Input (2) for refund Input (3) for exit 1 No Description Quantity Price($) Please input (0) for proceed to checkout Please input (1) for remove products Please input (2) for modify quantities of products Please input (3) to cancel the checkout process
(In reply to chakfpoon2-c from comment #1) > The problem has been solved by adding a void in package user. > ============================================================================= > === public void removeCartAfterTransaction(Member member) { member.getCart().clear(); } > ============================================================================= > === > Please input your Worker ID for logging in the system... > 1 > Please input your Member ID for logging in the system... > 1234 > ---Welcome to Morx Supermarket--- > ---To continue, please proceed your actions--- > Input (1) for accessing Inventory System > Input (2) for accessing Checkout System > Input (3) for accessing Sales System > Input (4) for accessing Membership System > Input (5) for switching member > Input (6) to exit > 2 > ---Welcome to Checkout System, ON9.--- > Input commands for further management: > Input (1) for Checkout > Input (2) for refund > Input (3) for exit > 1 > No Description Quantity Price($) > > 1 candies 100 3000.0 > > 2 Calcium Blocks 100 15000.0 > > 3 Coke 560 5600.0 > > Please input (0) for proceed to checkout > Please input (1) for remove products > Please input (2) for modify quantities of products > Please input (3) to cancel the checkout process > 0 > The total amount is: $22420.00 > Please Input the amount of dollars that the customers paid > 22420 > Total changes is $0.00 > Input commands for further management: > Input (1) for Checkout > Input (2) for refund > Input (3) for exit > 3 > Exiting... > ---To continue, please proceed your actions--- > Input (1) for accessing Inventory System > Input (2) for accessing Checkout System > Input (3) for accessing Sales System > Input (4) for accessing Membership System > Input (5) for switching member > Input (6) to exit > 2 > ---Welcome to Checkout System, ON9.--- > Input commands for further management: > Input (1) for Checkout > Input (2) for refund > Input (3) for exit > 1 > No Description Quantity Price($) > > Please input (0) for proceed to checkout > Please input (1) for remove products > Please input (2) for modify quantities of products > Please input (3) to cancel the checkout process