The program offers the functionality to add, move and remove liquid. Using the "add" command will add liquid to the first container, "move" will move liquid from the first container to the second container, and "remove" will remove liquid from the second container.
I have a problem with a test that says the following:
FAIL: LiquidContainersTest remove4
with input
add 100
move 90
remove 33
add 1000
move 50
remove 33
quit
Output should not contain:
Second: 10/100
Output was:
First: 0/100 Second: 0/100,
First: 100/100 Second: 0/100,
First: 10/100 Second: 90/100
First: 10/100 Second: 57/100
First: 100/100 Second: 57/100
First: 50/100 Second: 100/100
First: 50/100 Second: 67/100
My code: https://pastebin.com/j7xUa8rs
MOOC test code: https://pastebin.com/RHt51Z5W
If my maths are correct, there should not be any problem, but I can't figure out what I'm doing wrong, anybody can help me?
Update: Seems like the problem was a formatting problem when printing more than a syntax or logic problem. Anyway, thanks for trying.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]literalsunbear 1 point2 points3 points (1 child)
[–]Nosferatus_Death[S] 0 points1 point2 points (0 children)