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 trial

Java Java Objects (Retired) Creating the MVP Comparing Characters

isral bustami
PLUS
isral bustami
Courses Plus Student 5,932 Points

confused

how to solve this

ConferenceRegistrationAssistant.java
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;
  }

}
Lucas Santos
Lucas Santos
19,315 Points

Would 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.

3 Answers

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Double 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.

I did this after ... int line = 0;

if( lastName.charAt(0) <='Q')  line=1;
    else line=2;
Craig Dennis
Craig Dennis
Treehouse Teacher

Why Q? Where'd your brackets go?

Other than that, you nailed it.

I do not know why Q. It can be any letter... i think so.

About brackets - i forgot them

isral bustami
PLUS
isral bustami
Courses Plus Student 5,932 Points

i 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..