Purpose: Calculate Sum & Average of elements in Array.
Liquid UI Code:
var array_sum = 0;
var averge;
var num = [23,65,89,54,74];
var array_length = num.length;
for(var k=0;k<num.length;k++)
{
if(num[k] > 0)
{
array_sum = array_sum + num[k];
}
}
average = array_sum/array_length;
println("Sum of integers in Array="+array_sum);
println("Average of Integers in Array="+average);