Is there a bug in TMC testing code? Week 10 exercise 30

58 views
Skip to first unread message

raudas...@gmail.com

unread,
Jan 18, 2017, 12:30:49 PM1/18/17
to mooc.fi
Hi,

I'm having problems with week 10 exercise 30 on course Java II.

TMC tells me this:

ComparisonFailure: remember to keep containerhistory up-to-date when calling addToTheContainer and takeFromTheContainer!
check code
check code
mtv = new ProductContainerRecorder("kahvi",10,5);
mtv.addToTheContainer(5);
mtv.takeFromTheContainer(3);
mtv.history()  expected:<[5.0, 10.0, [3].0]> but was:<[5.0, 10.0, [7].0]

If volume is first 5, then added 5 and finally reduced 3, i can't understand why output expected to be 5, 10, 3. Of course it should be 5,10,7 (5,(5+5),(5+5-3). Or is there something i am missing?

br
Antero

raudas...@gmail.com

unread,
Jan 21, 2017, 3:29:58 AM1/21/17
to mooc.fi, raudas...@gmail.com
Now the error message is:
ComparisonFailure: remember to keep containerhistory up-to-date when calling addToTheContainer andtakeFromTheContainer! 
check code check code
mtv = new ProductContainerRecorder("kahvi",10,5); mtv.addToTheContainer(5);

mtv.takeFromTheContainer(3); mtv.history() 

expected:<[5.0, 10.0, [3].0]> but was:<[5.0, 10.0, [7].0]>,

and my output is
compile:
run:
[5.0, 10.0, 3.0]. Really don't get it...


raudas...@gmail.com

unread,
Jan 21, 2017, 3:37:55 AM1/21/17
to mooc.fi, raudas...@gmail.com
Reply all
Reply to author
Forward
0 new messages