PA2 can be done either in two-people teams (using pair programming) or individually - see programming policies. If you are working with a partner, be sure that both partners' names are in a comment at the top of the source code file, and be sure to properly form a group for this project in the submit.cs system.
sum.cpp
to solve a variation (as specified below) of the problem described in Chapter 2,
Programming Project 9:
Write a program that first reads in how many whole numbers the user wants to sum [always 10 in the textbook's simpler version], then reads in that many whole numbers, and finally outputs the sum of all the numbers greater than zero, the sum of all the numbers less than zero (which will be a negative number or zero), and the sum of all the numbers, whether positive, negative, or zero. The user enters the numbers just once each and the user can enter them in any order. Your program should not ask the user to enter the positive numbers and the negative numbers separately.
First look at a typical session (user input is bold), then read detailed comments below:
-bash-4.3$ ./sum How many numbers will you enter? 6 Enter 6 whole numbers while I count down. Entries left to go: 6 19 Entries left to go: 5 -4 Entries left to go: 4 0 Entries left to go: 3 -6 Entries left to go: 2 3 Entries left to go: 1 -4 The sum of 2 numbers greater than zero is 22. The sum of 3 numbers less than zero is -14. The sum of all 6 numbers is 8. Goodbye.
How many numbers will you enter? 0 There is nothing to sum. Goodbye.
~submit/submit -p 937 sum.cppBe sure to wait for the test results. If you score 50/50 and you've followed all of the other rules, then you'll earn full credit.