Skip to content

Conversation

@VynnykVV
Copy link

No description provided.

"I HATE YOU" || "Chill out!"
"Wait! Hang on. Are you going to be OK?" || "Yeap."
" " || "Fine."
" " || "Fine."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't modify tests.

}
}
char[] aA = a.toCharArray();
char[] a1A1 = a1.toCharArray();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for this 2 additional variables.
String has method chatAt that will given you character at some position.

"Enter 'div' to perform division.\n " +
"Enter 'exit' to exit.\n " +
"Enter 'help' to see help message.\n ");
int exit=1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For such purposes it's better to use boolean variables.

default: System.out.println("WRONG!");
break;

}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what about help command ? I don't see any handler for help.

System.out.print("Make your choice.\n");
Scanner sc = new Scanner(System.in);
String s1 = sc.nextLine();
if (s1.equals("exit")) {System.out.println("Bye-bye.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is actually no need for this check. It'll be better if you could move all possible commands cases into switch statement. And also do not forget about code duplication - create additional functions if they'll help you.


if (anger==phrase&&anger!=notAnger){return "Chill out!";}

return "Whatever.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've done lots of operations that could be avoided.
Try to solve task step-by-step, so that if you already know that it's question - don't do anything related to yelling.
Also, there is easier way to check if it's question or not - just use endWith String method.

@xSAVIKx xSAVIKx self-assigned this Nov 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants