Skip to content
Snippets Groups Projects
Commit d948dd09 authored by Minh Dan Nguyen's avatar Minh Dan Nguyen
Browse files

Added division method.

parent 591e44b2
Branches divisionMethod
No related tags found
No related merge requests found
......@@ -80,4 +80,13 @@ public class CalculatorResource {
return number1 * number2;
}
private int division(String equation){
String[] split = equation.split("[/]");
int number1 = Integer.parseInt(split[0]);
int number2 = Integer.parseInt(split[1]);
return number1/number2;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment