nevermind i figured it out
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
nevermind i figured it out
Last edited by noel222; February 11th, 2012 at 06:52 PM.
Read the API doc for the String class. There are many methods there that will be useful to you.
Java Platform SE 6
Can you recommend anything. I know how to make the string all lowercase. It is just that I don't know how to tell the program to accept the all lowercase answer as correct
Click on norms link, Ctrl F and search for 'case', and cycle through the results.
Please use [highlight=Java]//code goes here...[/highlight] tags when posting your code
nevermind i figured it out
Last edited by noel222; February 11th, 2012 at 06:52 PM.
If you'll explain what that method is supposed to do, maybe someone can tell you what it does.I know how to make the string all lowercase, I am having a problem telling the program to accept it. This is what I have, can somebody PLEASE tell me what I am doing wrong.
public boolean isRightPlayer(String player, String Nickname) {
boolean isRightPlayer = false;
if (player == player.toLowerCase() && nickname == nickname.toLowerCase())
isRightPlayer = true;
return isRightPlayer;
}
One quick way to find out is to test it. Call it with many different types of Strings and observe the results and see if they are what you want.
nevermind i figured it out
Last edited by noel222; February 11th, 2012 at 06:53 PM.
private static void Correctly() { setup(); if (!team.isRightPlayer("KeiTh SMITH", "hammer")) System.out.println("Incorrectly case-rejected show: Keith"); if (!team.isRightNickname("HAMMER", "kEItH smith")) System.out.println("Incorrectly case-rejected star: Keith");Please show some examples. Something like:can't get the code to see that the two names are the same
Then post the results and explain which should be true and which should be falseSystem.out.println("test1: " + team.isRightPlayer("KeiTh SMITH", "hammer"));
Can you answer these questions about the isRightPlayer() method
It will return true if ....
It will return false if ....
replace the ... with the condition(s) that describe when that value will be returned