Answer:
The solution code is written in Python 3
Explanation:
Firstly, we create four variables, total , count, neg and pos (Line 1- 4). This is to prepare the variable to hold the value of summation of input integer (total), total number of input number (count), total negatives (neg) and total positives (pos).
Next, we prompt user for the first integer (Line 6).
Create a sentinel while loop and set the condition so long as the current input number, num is not equal to zero. the program will just keep adding the current num to total (Line 9) and increment the count by one (Line 10).
if num smaller than zero, increment the neg by one (Line 13) else increment the pos by one (Line 15). This is to track the total number of positives and negatives.
Finally, we can display all the required output (Line 20 - 23) using the Python built-in function print() when user enter 0 to terminate the while loop. The output shall be as follows:
The number of positives: 3
The number of negatives: 1
The total is 5
The average is 1.25