Last active
March 22, 2016 13:19
-
-
Save alexejVasko/e755a4c9297688eaaaa5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package calculator; | |
public class StringCalculator { | |
public static void main(String[] args) { | |
StringCalcScanner scanner = new StringCalcScanner(); | |
while (true) { | |
System.out.println("Please, enter Your choice '1'(read from file) or '2'(manual input) or '3' to exit: "); | |
String choice = scanner.scanString(); | |
if (choice.equals("1")) { | |
String line; | |
line = StringFileReader.FileReader(); | |
StringDoubleCalculating.precondition(line); | |
} else if (choice.equals("2")) { | |
System.out.println("Please, enter the whole operation(x +-*/ y) "); | |
String scanLine = scanner.scanString(); | |
StringDoubleCalculating.precondition(scanLine); | |
}else if (choice.equals("3")) { | |
break; | |
} else { | |
continue; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment