C++ Vending Machine Change issue | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

C++ Vending Machine Change issue

https://code.sololearn.com/cT0ZGzNd41B8/?ref=app I’m having issues with the change part it keep on giving me lots of quarters why isn’t it giving me bills instead

26th Feb 2021, 12:27 PM
Jason Salem
 Jason Salem - avatar
1 Antwort
+ 1
The change-making if statements are missing braces. One example: if (moneyLeft >= 100) hundred = moneyLeft / 100; moneyLeft = moneyLeft % 100; It should be: if (moneyLeft >= 100) { hundred = moneyLeft / 100; moneyLeft = moneyLeft % 100; }
27th Feb 2021, 7:53 PM
Brian
Brian - avatar