12345678910111213141516171819202122232425262728293031323334 |
- 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);
- while(this.on == true)
- {
- String userInput = scanner.nextLine();
- calculator.getCommand(userInput);
- }
- }
-
- public void Power(){
- this.on = !this.on;
- this.Run();
- }
- }
|