Please help me guys


#1
public class Calculator {

 public int add(int a, int b) {

return a + b ;
}

public int subtract(int a , int b) {
  return a - b ;
}

public int multiplay(int a , int b) {
  return a * b ;
}

public int divide(int a , int b) {

if (b == 0) {
  System.out.println("Error! Dividing by zero is not allowed.") ;

} else {

  return a / b ;
}
}

public int modulo(int a , int b) {

  if (b == 0) {

    System.out.println("Error! Dividing by zero is not allowed") ;

      return 0 ;

  } else {

    return a % b ;
  }
} 

public static void main(String[] args) {

	Calculator myCalculator = new Calculator();
        System.out.println(myCalculator.add(5,7));
        myCalculator.subtract(45, 11);
    
}

}

#2

there is only one wrong and it says ;
Calculator.java:26: error: missing return statement
}
^
1 error


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.