The arithmetic whisperer's challenge

Report a typo
Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!
Fill in the blanks to complete a Calculator class that performs basic arithmetic operations. The class should handle null inputs and division by zero gracefully. What should go in each blank to make the code work correctly?
Fill in the gaps with the relevant elements
  Calculator {
    public  int calculate( a, Integer b,  operation) {
        int x = (a != null) ? a : 0;
        int y = (b != null) ? b : 0;
        switch (operation) {
            case '+': return x + y;
            case '-': return x - y;
            case '*': return x * y;
            case '/': return (y != 0) ? x / y : 0;
            default: return 0;
        }
    }
}
StringfinalDoublestaticclassinterfacepubliccharIntegerprivate

Create a free account to access the full topic