Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Integer iArrayCount
- Integer iLoop
- Number nVal
- Number nLargest
- Number nSmallest
- Number nTotal
- Number nAverage
- Number nNeutralNo
- Number nPositiveNo
- Number nNegativeNo
- String sResult
- Move "" to sResult
- Get Item_Count of oMyNumbers to iArrayCount
- Move 0 to nTotal
- Move 0 to nNeutralNo
- Move 0 to nPositiveNo
- Move 0 to nNegativeNo
- For iLoop from 0 to (iArrayCount - 1)
- Get Value of oMyNumbers item iLoop to nVal
- // If (nVal ne 999999) Begin
- If (iLoop eq 0) Begin
- Move nVal to nLargest
- Move nVal to nSmallest
- End
- Else Begin
- If (nVal gt nLargest) Move nVal to nlargest
- If (nVal lt nSmallest) Move nVal to nSmallest
- End
- If (nVal gt 0) Move (nPositiveNo +1) to nPositiveNo
- Else If (nVal lt 0) Move (nNegativeNo +1) to nNegativeNo
- Else Move (nNeutralNo +1) to nNeutralNo
- Move (nTotal +nVal) to nTotal
- // End
- Loop
- Move (nTotal/iArrayCount) to nAverage
- Append sResult "Number of data entries: " iArrayCount sLineFeed "Total: " nTotal sLineFeed "Average: " nAverage sLineFeed sLineFeed
- Append sResult "Number of positive values: " nPositiveNo sLineFeed "Number of negative values: " nNegativeNo sLineFeed "Number of neutral values (0's): " nNeutralNo
- Append sResult sLineFeed sLineFeed "Largest value: " nLargest sLineFeed "Smallest value: " nSmallest
- Send Info_Box sResult "Array data results"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement