// membership.js #2 // This script calculates the cost of a membership. // Function called when the form is submitted. // Function performs...

profileamnborj12m6

// membership.js #2
// This script calculates the cost of a membership.

// Function called when the form is submitted.
// Function performs the calculation
// and prevents the default browser behavior.

/*Task 1 through 4
Add four functions, called "addition",
"multiplication",
"division", and "modulus".
Each function should take two arguments, and
should perform the appropriate calculation
per the name of each function
(i.e. addition returns arg1 + arg2, etc.)

Task 5:
Add a function "power" that takes two arguments, and
raises the first argument to the power of the second argument.
A simple way to implement this is with this loop:
    for (var i = 0; i < [argument 2]; i++) {
        result = result * [argument 1];
    }

Task 6:
Add a function "maxOfAB" that takes two arguments and determines
which is larger
*/

    • 10 years ago
    • 999999.99
    Answer(0)
    Bids(0)
    other Questions(10)