Exercise 94.3 Stuck at 93%

44 views
Skip to first unread message

jakobO

unread,
Apr 25, 2017, 12:10:47 PM4/25/17
to mooc.fi
Hi,

I'm having problems with week 6 exercise 94.3  on course Object-Oriented Programming with Java, part I.
.

*Explain your problem here in English or Finnish*

Hi guys,

I am currently getting following error message:

"ComparisonFailure: Check code p = new Phonebook(); p.add("Pekka", "040-123654"); p.add("Jukka", "045-332211");  p.searchNumber("Pekka");
 expected:<[040-123654]> but was:<[]>"

However, I pasted the code and my code is indeed returning 040-123654 - contrary to what the tmc check is telling me.
Could you please have a short look at my work and could give me a hint?


Many thanks in advance and best regards,

Jakob


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

jakobO

unread,
Apr 28, 2017, 4:45:36 AM4/28/17
to mooc.fi
Found a solution.

I used a helper string "number not known", which was changed and returned, if the searched name occured. Else the helper return will be returned unchanged.

Not the model solution, but working up to my - and TMC's - satisfaction.
Reply all
Reply to author
Forward
0 new messages