Skip to content
Snippets Groups Projects
Commit d7f15e55 authored by Maiken Louise's avatar Maiken Louise
Browse files

Test

parent 73d37edc
Branches
Tags
No related merge requests found
Pipeline #114605 passed
......@@ -43,6 +43,23 @@ public class CalculatorResource {
return result;
}
private int multiplication(String equation){
String[] split = equation.split("*");
int number1 = Integer.parseInt(split[0]);
int number2 = Integer.parseInt(split[1]);
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;
/**
* Method used to calculate a sum expression.
* @param expression the equation to be calculated as a String
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment