Main.java 886B

123456789101112131415161718192021222324252627282930
  1. /**
  2. *
  3. */
  4. import java.util.Scanner;
  5. public class Main
  6. {
  7. public static void main(String[] args){
  8. Scanner s = new Scanner(System.in);
  9. System.out.println("Welcome to this short calculator!");
  10. System.out.println("Please enter two numbers between 0 and 65535.");
  11. System.out.print("First number: ");
  12. short x = (short) s.nextInt();
  13. System.out.print("Second number: ");
  14. short y = (short) s.nextInt();
  15. ShortCalculator calc = new ShortCalculator(x, y);
  16. System.out.println("Sum = " + calc.getSum());
  17. System.out.println("Difference = " + calc.getDifference());
  18. System.out.println("Quotient = " + calc.getQuotient());
  19. System.out.println("Remainder = " + calc.getRemainder());
  20. System.out.println("Thank you for using this short calculator!");
  21. }
  22. }