java.lang.Object
net.kessra.test.Calculator
Simple demo calculator which allows to
add(int, int), subtract(int, int), multiply(int, int) and divide(int, int) to input arguments.-
Method Summary
Modifier and TypeMethodDescriptionstatic intadd(int a, int b) Adds two provided numbers.static doubledivide(int a, int b) Divides the first number by the second number.static intmultiply(int a, int b) Multiplies the first number with the second one.static intsubtract(int a, int b) Subtracts the second number from the first one.
-
Method Details
-
add
public static int add(int a, int b) Adds two provided numbers.- Parameters:
a- The first number of the additionb- The second number of the additon- Returns:
- The result of the addition
-
subtract
public static int subtract(int a, int b) Subtracts the second number from the first one.- Parameters:
a- The first number of the subtractionb- The second number of the subtraction- Returns:
- The difference of subtracting the second number from the first one
-
multiply
public static int multiply(int a, int b) Multiplies the first number with the second one.- Parameters:
a- The first number of the multiplicationb- The second number of the multiplication- Returns:
- The product of multiplying the first number with the second one
-
divide
public static double divide(int a, int b) Divides the first number by the second number.- Parameters:
a- The dividend of the divisionb- The divisor of the division- Returns:
- The quotient of the division
-