Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialisral bustami
Courses Plus Student 5,932 Pointsconfused
how to solve this
public class ConferenceRegistrationAssistant {
public int getLineFor(String lastName) {
/* If the last name is between A thru M send them to line 1
Otherwise send them to line 2 */
int line = 0;
if (char lineOne = lastName.charAt(0) <= 'M')
}
System.out.println("Line 1");
} else {
System.out.println("Line 2");
}
return line;
}
}
3 Answers
Craig Dennis
Treehouse TeacherDouble check your parenthesis, and instead of printing, why not set the line variable? It gets returned to the caller of the method in the last line there.
Lubomyr Kaminskiy
830 PointsI did this after ... int line = 0;
if( lastName.charAt(0) <='Q') line=1;
else line=2;
Craig Dennis
Treehouse TeacherWhy Q? Where'd your brackets go?
Other than that, you nailed it.
Lubomyr Kaminskiy
830 PointsI do not know why Q. It can be any letter... i think so.
About brackets - i forgot them
isral bustami
Courses Plus Student 5,932 Pointsi got it solved.. thank you much craig.. i don't really understand about what- to go-where and where to write.. but i`m going to continue on the courses, hopefully i am able to figure it out.. i am completely newbie on this matter.. really need guidance and advise.. again and again thank you craig..
Lucas Santos
19,315 PointsLucas Santos
19,315 PointsWould help if you paste in the question along with the original code of the challenge so we can know what you're suppose to achieve.