Main.java 865B

123456789101112131415161718192021222324252627
  1. import java.util.Scanner;
  2. /**
  3. * Write a description of class Main here.
  4. *
  5. * @author (your name)
  6. * @version (a version number or a date)
  7. */
  8. public class Main
  9. {
  10. public static void main(String[] args) {
  11. Scanner reader = new Scanner(System.in);
  12. System.out.println("Enter two numbers between 0 and 65535");
  13. System.out.println("Input the first number:");
  14. short n1 = (short) reader.nextInt();
  15. System.out.println("Input the second number:");
  16. short n2 = (short) reader.nextInt();
  17. ShortCalculator calc = new ShortCalculator(n1,n2);
  18. calc.printLine("Sum", calc.sum());
  19. calc.printLine("Difference", calc.difference());
  20. calc.printLine("Product", calc.product());
  21. calc.printLine("Quotient", calc.quotient());
  22. calc.printLine("Remainder", calc.remainder());
  23. }
  24. }