Week 9 exc 20

108 views
Skip to first unread message

sander...@gmail.com

unread,
Oct 29, 2015, 12:51:38 PM10/29/15
to mooc.fi
Hi,

I'm having problems with week 9 exercise 20.

The last test that doesn't pass is giving:
Returned list should be empty with code
AverageSensor ka = new AverageSensor();
ka.addSensor( new ConstantSensor(3) );
ka.addSensor( new ConstantSensor(7) );
ka.readings();

The average sensor is on when all its sensors are on. In this case they are all on I would think.What do I miss?

The link to my work is here: PASTE TMC PASTEBIN LINK HERE

Best regards
Sander

Supported languages are English and Finnish

Please use our build in TMC Pastebin when asking questions related to your code  
 
TMC Plugin has built-in code sharing feature. 
In NetBeans, select TMC -> Send code to TMC pastebin. Copy the link you receive and paste it to your message.  

You may use our web interface to share code snippets: http://paste.mooc.fi

Jarmo Isotalo

unread,
Oct 29, 2015, 6:54:57 PM10/29/15
to Sander Sprong, mooc.fi
W/o code the exact issue is hard to tell (In NetBeans, select TMC -> Send code to TMC pastebin. Copy the link you receive and paste it to your message.)  but often there is some confusion about what exactly is in the readings list, which is returned by the readings method.
It should store the avg temperature each time the the measure is called for the avg sensor. And the readings does no measuring, it just returns the values measured so far.

--
http://mooc.fi
---
You received this message because you are subscribed to the Google Groups "mooc.fi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moocfi+un...@googlegroups.com.
To post to this group, send email to moo...@googlegroups.com.
Visit this group at http://groups.google.com/group/moocfi.
To view this discussion on the web visit https://groups.google.com/d/msgid/moocfi/c3910561-99aa-49b1-b5ce-1fde040a2b86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages