Skip to content
Snippets Groups Projects
Commit e6e8bf6c authored by Jo Kristian Aarvaag's avatar Jo Kristian Aarvaag :cartwheel_tone1:
Browse files

reverta changes

parent ea1228dd
Branches
No related tags found
No related merge requests found
Pipeline #119662 passed
...@@ -80,11 +80,18 @@ public class CalculatorResource { ...@@ -80,11 +80,18 @@ public class CalculatorResource {
public int multiplication(String expression){ public int multiplication(String expression){
String[] split = expression.split("[*]"); String[] split = expression.split("[*]");
int product = 0;
for (String s : split){ int number1 = Integer.parseInt(split[0]);
product *= Integer.parseInt(s); int number2 = Integer.parseInt(split[1]);
}
return product; return number1*number2;
// String[] split = expression.split("[*]");
// int product = 0;
// for (String s : split){
// product *= Integer.parseInt(s);
// }
// return product;
//int number1 = Integer.parseInt(split[0]); //int number1 = Integer.parseInt(split[0]);
// int number2 = Integer.parseInt(split[1]); // int number2 = Integer.parseInt(split[1]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment