Answer to Question #239655 in Java | JSP | JSF for jersonjangerona

Question #239655

A Basic Calculator

In this project, you will use classes, methods, and objects to create a simple arithmetic calculator. The calculator will be able to:

  • Add two integers
  • Subtract two integers
  • Multiply two integers
  • Divide two integers
  • Apply the modulo operator on two integers
1
Expert's answer
2021-09-20T07:48:21-0400
class BasicCalculator {
    int add(int a, int b) {
        return a + b;
    }
    int sub(int a, int b) {
        return a - b;
    }
    int mult(int a, int b) {
        return a * b;
    }
    int div(int a, int b) {
        return a / b;
    }
    int mod(int a, int b) {
        return a % b;
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS