Problem with (Exercise 88 - Students).

197 views
Skip to first unread message

tallk...@gmail.com

unread,
Jan 6, 2016, 5:17:18 PM1/6/16
to mooc.fi
Hi,

I'm having problems with week 5 exercise 88.


I am unsure why the test output gives me errors, because the program itself is working.

The error message: 
"The search did not work as expected. With input "Martti" "123" "Arto" "333" and rearch term "to"
Ensure that your main program works according to the assignment definition.
 Output was:
result: [Martti (123) , Arto (333) ]
Give search term: 
Arto (333) 
name:"

Thankful for answers!

BR Tallkotteh

Jarmo Isotalo

unread,
Jan 6, 2016, 5:33:29 PM1/6/16
to Conan Olol, mooc.fi
The issue might become clearer once the code is properly indented..

At least the "name: " should be printed with out line break. Note the difference between System.out.println() and System.out.print()



--
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 https://groups.google.com/group/moocfi.
To view this discussion on the web visit https://groups.google.com/d/msgid/moocfi/fa40fab4-ce4b-4868-90a0-d8c3a8da3653%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tallk...@gmail.com

unread,
Jan 12, 2016, 7:03:49 AM1/12/16
to mooc.fi, tallk...@gmail.com
Hello, 

I have inserted linebreaks and removed brackets from the output and now the code looks identical to the MOOC's example output. 
I am still getting the same error, I am having trouble finding the cause behind it.


Thanks in advance!

BR tallkotteh

ljleppan

unread,
Jan 13, 2016, 4:09:50 AM1/13/16
to mooc.fi, tallk...@gmail.com
Hi tallkotteh,

The issue seems to be that you are printing the line "Result:" twice. Just remove the first instance of that and you should be able to pass all tests.

-Leo

tallk...@gmail.com

unread,
Jan 13, 2016, 10:28:54 AM1/13/16
to mooc.fi, tallk...@gmail.com
I thought I had tried that before without success, however this time it worked! 
Thank you for your time and answer!
Reply all
Reply to author
Forward
0 new messages