Question: ) Start by creating an OrderedCollection and filling it with eight random SmallIntegers whose values are between - 2 0 and 2 0 , inclusive.
Start by creating an OrderedCollection and filling it with eight random SmallIntegers
whose values are between and inclusive. Print the OrderedCollection to the
Transcript.
Hint: You are not required to use it but you might find the atRandom unary message
useful. Try passing it to an Array or collection and print the result.
Find and print the sum of the positive integers, and the sum of the negative integers.
Find the subsequence whose elements produce the largest sum. Print the subsequence
and print the sum. A 'subsequence' is defined as a sequence of contiguous elements
from the original collection.
For example, if the collection is:
Then the maximum subsequence sum is :
Note: Im not expecting anything asymptotically efficient here. A simple On nested
loop approach is just fine. You can try for the
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
