Last active
August 29, 2015 14:06
-
-
Save AliZafar120/77465f8dd36fa38760ea to your computer and use it in GitHub Desktop.
BasicCalculator for extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BasicCalculator { | |
public float add(float a,float b) | |
{ | |
return a+b; | |
} | |
public float subtract(float a,float b) | |
{ | |
return a-b; | |
} | |
public float multiply(float a,float b) | |
{ | |
return a*b; | |
} | |
public float divide(float a,float b) | |
{ | |
return (float)a/b; | |
} | |
public float exponent(float a,float b) | |
{ | |
return (float) Math.pow(a, b); | |
} | |
public float squareroot(float a) | |
{ | |
return (float)Math.sqrt(a); | |
} | |
public float percentage(float a,float b) | |
{ | |
return a*b/100; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment