Question: Write a function named addPositive which has two input parameters: numbers (an array of 20 integers) and size (an integer representing the actual size of

Write a function named addPositive which has two input parameters: numbers (an array of 20 integers) and size (an integer representing the actual size of numbers) and two output parameters: numbers (an array of 20 integers) and sumPositive (integer). To compute sumPositive, add the number of values in the numbers array that are positive (above 0 - zero not included). Also, change any negative values in the number array to 0. There is no precondition. The postcondition of the function has two possible outcomes (1) the numbers array has 1 or more positive values (sumPositive is not zero) and the negative values have been changed in numbers, or (2) there are no positive values in the numbers array (sumPositive is 0) and all values were changed to zero in the numbers array. For examples, if the numbers array was {3, 5, -10, 12, -2, -5, 6} and size was 7, sumPositive is 26 (3+5+12+6) and the numbers array is {3, 5, 0, 12, 0, 0, 6}

the display array function has already been provided. Just need help with this function. writing in c++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!