// Add looping // and invoking a function // if we do not declare any statements in global // scope, the "Execute" method of object // "Program" will not be successful. // Instead select the "Factorial" function & // click on "Execute Function", to invoke the // "Execute" method of object "Function". // Use the UI to modify the value of variable // "Value" to 10 and execute "Factorial" to get // an "Answer" of 3628800. double Factorial(double Value) { double Answer = 1; // Only use the absolute integer portion of the double Value = Abs(Int(Value)); while (Value > 0) Answer *= Value--; return Answer; } // Factorial(10.78); // Uncomment the above line to invoke Factorial