Skip to content

Conversation

@OlgaBerezhna
Copy link

No description provided.

Copy link
Member

@xSAVIKx xSAVIKx left a comment

Choose a reason for hiding this comment

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

Please update your code to pass all the tests.

int result = 0;
for (int i = 0; i < a.length(); i++) {
if (a.charAt(i) != a1.charAt(i)) {
return result++;
Copy link
Member

Choose a reason for hiding this comment

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

for sure, you shouldn't return result here, you should only increment it here.


}

private static void makeChoice () {
Copy link
Member

Choose a reason for hiding this comment

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

This function should be renamed, as it don't really "make any choice", it just prints your "help" or "menu" messages.

if (input.equals("help")) {
makeChoice();
scanner.next();
}
Copy link
Member

Choose a reason for hiding this comment

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

I personally don't like such solution, where you move some switch clauses into separate if-else statements, I'd really prefer some other implementation where all possible commands would be inside one switch.

@xSAVIKx xSAVIKx self-assigned this Dec 12, 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