CPPForSchool.com: Flow of Control Set 2: Assignment 9

9. Write a program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros entered.


This assignment was actually quite fun.  I had to sit down and create pseudo-code to simply cout statements.  Eventually, once the menu responded with the expected outcome, it was a matter of keeping track of the user inputs, specifically if the number was negative, positive, or zero.  When compared to the sample solution, my version does not deviate too far.  Instead of utilizing a do/while loop, I simply used a while loop.  Also, the sample solution does not ask if the user wants to participate, it goes straight into asking for a number.












Comments

Popular posts from this blog

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 9

CPPForSchool.com: Array - Single Dimension Set 1 Assignment 6

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 8