service { const html setupFactorial =

Welcome to our WIG Factorial Service

Enter a number to calculate it's Factorial (0-20): ; const html setupPower =

Welcome to our WIG Power Service

Enter a two numbers to calcuate power (0-20): ; const html setupFibonacci =

Welcome to our WIG Fibonacci Service

Enter a number (0-100): ; const html answerFactorial =

The Result Page

The Factorial is : <[factResult]>

Would you care for another calculation (yes or no)? ; const html answerPower =

The Result Page

The Power is : <[powerResult]>

Would you care for another calculation (yes or no)? ; const html answerFibonacci =

The Result Page

Fibonacci Value is : <[fibResult]>

Would you care for another calculation (yes or no)? ; const html Ciao =

Thankyou for using the WIG service

; int factResult; int powerResult; int fibResult; session CalculateFactorial() { int fact; string value; value = ""; while (value != "no") { show setupFactorial receive[fact=fact]; factResult = fact; if((fact == 0) || (fact == 1)) { factResult = 1; } while(fact > 1 ) { factResult = (factResult * (fact-1)); fact = fact - 1; } show plug answerFactorial[factResult = factResult] receive[value = value]; } exit Ciao; } session CalculatePower() { int base, exponent; string value; value = ""; while (value != "no") { show setupPower receive[base=base, exponent=exponent]; powerResult = base; if(exponent == 0) { powerResult = 1; } else if(exponent == 1) { powerResult = base; } while(exponent > 1) { powerResult = powerResult * base; exponent = exponent-1; } show plug answerPower[powerResult = powerResult] receive[value = value]; } exit Ciao; } session CalculateFibonacci() { int i,last,nextToLast,fib; string value; value = ""; while(value != "no") { show setupFibonacci receive[fib = fib]; fibResult = 1; i = 2; last = 1; nextToLast = 1; while(i <= fib) { fibResult = last + nextToLast; nextToLast = last; last = fibResult; i = i + 1; } show plug answerFibonacci[fibResult = fibResult] receive[value = value]; } exit Ciao; } }