MainApplication.java 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import java.util.Scanner;
  2. public class MainApplication {
  3. public static void main(String[] args) {
  4. // Console.println("Welcome to my calculator!");
  5. // String s = Console.getStringInput("Enter a string");
  6. // Integer i = Console.getIntegerInput("Enter an integer");
  7. // Double d = Console.getDoubleInput("Enter a double.");
  8. // Console.println("The user input %s as a string", s);
  9. // Console.println("The user input %s as a integer", i);
  10. // Console.println("The user input %s as a d", d);
  11. String output = Console.getStringInput("type something");
  12. Console.println(output);
  13. }
  14. public void runCommandLoop() {
  15. Scanner input = new Scanner(System.in);
  16. Scanner input2 = new Scanner(System.in);
  17. while (true) {
  18. System.out.print("Enter a command: ");
  19. String command = input.next();
  20. if (command.equalsIgnoreCase("exit")){
  21. System.out.print("Thanks for calculating with us!");
  22. break;
  23. }
  24. if (command.equalsIgnoreCase("add")){
  25. //input = Console.getIntegerInput("type a number");
  26. //input2 = y;
  27. //calc.add(x,y);
  28. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  29. }
  30. }
  31. }
  32. }