it says "returns the difference between a and b", don't we have to take absolute value of it? Or it will be negative value if b>a.
package com.codegym.task.task06.task0612;
/*
Calculator
*/
public class Calculator {
public static int plus(int a, int b) {
//write your code here
int result = a+b;
return result;
}
public static int minus(int a, int b) {
//write your code here
int result = (a>b) ? (a-b) : (b-a);
return result;
}
public static int multiply(int a, int b) {
//write your code here
int result = a*b;
return result;
}
public static double divide(int a, int b) {
//write your code here
double c = a;
double d = b;
double result = c/d;
return result;
}
public static double percent(int a, int b) {
//write your code here
double c = a;
double d = b;
double result = c*d/100;
return result;
}
public static void main(String[] args) {
}
}