Answer:
I will code in Javascript:
function sumOddAndEven(){
<em> //Define and initialize variables.</em>
var numbers = [1,2,3,4,5,6,7,8];
var sum = [0,0];
for ( var i = 0; i < numbers.length ; i++ ){ <em>// loop to go throght the numbers</em>
<em> </em>if(numbers[i] > 0) {<em> // if the number is positive</em>
if(numbers[i]%2 == 0) { <em>// if number is even and </em>
sum[0] = sum[0] + numbers[i]; <em>//adds in the first place of sum</em>
}
else{
sum[1] = sum[1] + numbers[i]; <em>// else adds in the second place of sum</em>
}
}
}
return sum; <em>//return an array with the sum of the positive evens numbers in the first place and the sum of the positive odd numbers in the second place.</em>
}