Conversation
| return ""; | ||
|
|
||
|
|
||
| if (phrase.equals(phrase.toUpperCase()) ) { |
There was a problem hiding this comment.
The thing is, that "1 2 3".toUpperCase() is the same as 1 2 3.
There are two ways, first one - use regexp figure out whether string contains upper case letters. Second one - additionally use toLowerCase().
| if (phrase.equals(phrase.toUpperCase()) ) { | ||
| return "Chill out!"; | ||
| } | ||
| else if (phrase.endsWith("?")) { |
| import java.util.Scanner; | ||
|
|
||
| public class ConsoleCalculator { | ||
| public int Add(int scannetFirstNumInt, int scannetSecondNumInt, String scannerOperations) { |
There was a problem hiding this comment.
Please use lowerCamelCase for method names https://ru.wikipedia.org/wiki/CamelCase
Also please use static for this methods, so it won't be needed to create instance of ConsoleCalculator
|
|
||
| System.out.println("Result of" + resultat); | ||
| System.out.println("Make your choice."); | ||
| Scanner scannerOperationsSecond = new Scanner(System.in); |
There was a problem hiding this comment.
One scanner will be enough for reading all numbers and operations, so no reason to create another one.
| System.out.println("Make your choice."); | ||
| Scanner scannerOperations = new Scanner(System.in); | ||
|
|
||
|
|
There was a problem hiding this comment.
User should have possibility to do more than one operations, so there should be a loop, until user enter exit.
1 done, 2 with some problem, without calculator