Write a program that reads in ten whole numbers and that outputs the sum of all the numbers greater than zero, the sum of all the numbers less than zero (which will be a negative or zero), and the sum of all the numbers, weather positive, negative or zero. The user enters the ten numbers just once and user can enter them in any order. Your program should not ask the user to enter positive numbers and the negative numbers separately.
1. Ask the user to input 10 arbitrary whole numbers.
2. Loop through the numbers.
- a. If the number is positive, add it to the sum of positive numbers.
- b. If the number is negative, add it to the sum of negative numbers.
- c. Add the number to the sum of all numbers.
3. Output the sums separately.
@greenleaf
the OP also requires the overall total
btw it seem a waste of resources to use a container to hold the data when it could be executed as Branflakes outlined in his/her algorithm