ShortCalculator.java 449B

12345678910111213141516171819202122
  1. public class ShortCalculator {
  2. public short sum(short x, short y){
  3. return (short) (x + y);
  4. }
  5. public short difference(short x, short y){
  6. return (short) (x - y);
  7. }
  8. public short product(short x, short y){
  9. return (short) (x * y);
  10. }
  11. public short quotient(short x, short y){
  12. return (short) (x / y);
  13. }
  14. public short remainder(short x, short y){
  15. return (short) (x % y);
  16. }
  17. }