home *** CD-ROM | disk | FTP | other *** search
- // %PARAMETERS = "CH18LIST C:\UT2004"
- //Identifies the package
- //SimpleMath.uc
-
- //This class provides math functions useful for working with basic math
- class SimpleMath extends Commandlet;
-
- //#1
- //-------------- addNums ----------------------------
- public function int addNums(int A, int B){
- return A + B;
- }
- //--------------subtractNums--------------------------
- public function int subtractNums(int A, int B){
- return A - B;
- }
- //-------------- multiplyNums ------------------------
- public function int multiplyNums(int A, int B){
- return A * B;
- }
- //-------------- divideNums --------------------------
- public function float divideNums(float A, float B){
- return B / A;
- }
- //-------------- makeCaps ----------------------------
- //#2
- public function string makeCaps(string exp){
- return Caps(exp);
- }
- //-------------- joinWords ---------------------------
- public function string joinWords(string expA,
- string expB){
- return expA $ expB;
- }
- //-------------- getCircumference --------------------
- //#3
- public function float getCircumference(float diameter){
- return (Pi * diameter);
- }
- //-------------- getArea -----------------------------
- public function float getArea(float radius){
- return (Pi * Square(radius) );
- }
-
-
-
-
-
-
-
-