Advertisement
glee20

Calculator

Oct 4th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. public class Calculator
  2. {
  3.     String name="***CALCULATOR***";
  4.    
  5.     public Calculator(){
  6.     }
  7.     public Calculator(String name){
  8.         this.name=name;
  9.     }
  10.     public String getName(){
  11.         return name;
  12.     }
  13.     public int add (int a, int b){
  14.         int result = a+b;
  15.         return (result);
  16.     }
  17.    
  18.     public int add (int a, int b, int c){
  19.         int result = a+b+c;
  20.         return (result);
  21.     }
  22.    
  23.     public double add (double a, double b){
  24.         double result = a+b;
  25.         return (result);
  26.     }
  27.    
  28.     public double multiply (double a, double b){
  29.         double result = a*b;
  30.         return (result);
  31.     }
  32.    
  33.     public double divide (double a, double b){
  34.         double result = a/b;
  35.         return (result);
  36.     }
  37.    
  38.     public double modulus (double a, double b){
  39.         double result = a%b;
  40.         return (result);
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement