Conversation
| "I HATE YOU" || "Chill out!" | ||
| "Wait! Hang on. Are you going to be OK?" || "Yeap." | ||
| " " || "Fine." | ||
| " " || "Fine." |
| } | ||
| } | ||
| char[] aA = a.toCharArray(); | ||
| char[] a1A1 = a1.toCharArray(); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
For such purposes it's better to use boolean variables.
| default: System.out.println("WRONG!"); | ||
| break; | ||
|
|
||
| }} |
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
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."; |
There was a problem hiding this comment.
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.
No description provided.