MainApplication.java 1001B

12345678910111213141516171819202122232425262728293031323334
  1. import java.util.Scanner;
  2. public class MainApplication {
  3. boolean on = false;
  4. Calculations calculator = new Calculations();
  5. Console console = calculator.console;
  6. public static void main(String[] args) {
  7. //Console.println("Welcome to my calculator!");
  8. //String s = Console.getStringInput("Enter a string");
  9. //Integer i = Console.getIntegerInput("Enter an integer");
  10. //Double d = Console.getDoubleInput("Enter a double.");
  11. //Console.println("The user input %s as a string", s);
  12. //Console.println("The user input %s as a integer", i);
  13. //Console.println("The user input %s as a d", d);
  14. }
  15. public void Run(){
  16. Scanner scanner = new Scanner(System.in);
  17. while(this.on == true)
  18. {
  19. String userInput = scanner.nextLine();
  20. calculator.getCommand(userInput);
  21. }
  22. }
  23. public void Power(){
  24. this.on = !this.on;
  25. this.Run();
  26. }
  27. }