123456789101112131415161718192021222324252627282930313233343536 |
- import java.util.Scanner;
-
- public class MainApplication {
- boolean on = false;
- Calculations calculator = new Calculations();
- Console console = calculator.console;
-
- public static void main(String[] args) {
-
- //Console.println("Welcome to my calculator!");
- //String s = Console.getStringInput("Enter a string");
- //Integer i = Console.getIntegerInput("Enter an integer");
- //Double d = Console.getDoubleInput("Enter a double.");
-
- //Console.println("The user input %s as a string", s);
- //Console.println("The user input %s as a integer", i);
- //Console.println("The user input %s as a d", d);
- }
-
- public void Run(){
- Scanner scanner = new Scanner(System.in);
- String result = "";
- while(this.on == true)
- {
- String userInput = scanner.nextLine();
- result = calculator.getCommand(userInput);
- System.out.println(result);
- }
- }
-
- public void Power(){
- this.on = !this.on;
- this.Run();
- }
- }
|