awesome-low-level-design icon indicating copy to clipboard operation
awesome-low-level-design copied to clipboard

JAVA: No amount validation in Vending Machine example

Open Ankitcode99 opened this issue 6 months ago • 0 comments

In the dispenseProduct() method there is no validation if the amount vending machine contains is greater than or equal to the price of selected item.

I can make a fix for this if assigned to me.

Error Line - https://github.com/ashishps1/awesome-low-level-design/blob/5cbc40df46e17bad34f99e7483b001aa50bf69fb/solutions/java/src/vendingmachine/DispenseState.java#L27

Similar Implementation of mine - https://github.com/Ankitcode99/Design-Patterns/blob/main/src/main/java/org/ankitcode99/statePattern/stateImplementation/SelectionState.java#L45

@ashishps1 can I work on this issue?

Ankitcode99 avatar Apr 24 '25 18:04 Ankitcode99