12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
-
-
- public class ShortCalculator {
-
- public void calculator(short x, short y){
-
-
- add(x,y);
- subtract(x,y);
- multiply(x,y);
- divide(x,y);
- remainder(x,y);
-
- }
-
- public short add(short a, short b){
- return (short)(a+b);
- }
-
- public short subtract(short a, short b){
- return (short)(a-b);
- }
-
- public short multiply(short a, short b){
- return (short)(a*b);
- }
-
- public short divide(short a, short b){
- return (short)(a/b);
- }
-
- public short remainder(short a, short b){
- return (short)(a%b);
- }
- /*
- * Write a program that reads in two numbers between 0 and 65535,
- * stores them in short variables, and computes their unsigned sum,
- * difference, product, quotient, and remainder ,
- * without converting them to int.
- */
-
-
-
- }
-
|