Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Calculator
- {
- String name="***CALCULATOR***";
- public Calculator(){
- }
- public Calculator(String name){
- this.name=name;
- }
- public String getName(){
- return name;
- }
- public int add (int a, int b){
- int result = a+b;
- return (result);
- }
- public int add (int a, int b, int c){
- int result = a+b+c;
- return (result);
- }
- public double add (double a, double b){
- double result = a+b;
- return (result);
- }
- public double multiply (double a, double b){
- double result = a*b;
- return (result);
- }
- public double divide (double a, double b){
- double result = a/b;
- return (result);
- }
- public double modulus (double a, double b){
- double result = a%b;
- return (result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement