how should i begin..

Trying to design an application that determines and prints the number of odd,even,and zero digits in an interger value read from keyboard.Guys i've done problems similar to this one and always get stuck in the same spot..

Hey thanks for your response .. so i've got it down with the checking if the interger is odd/even. Now to check and analyze every individual number in the interger , could i do something like a while loop, that keeps on taking the remainder of the interger to seperate each number then analyze each number ??

Do you mean, if the integer entered by the user is 345, then the program checks the 3, the 4, and the 5 (as in 300, 40, 5) or is it supposed to check every number below 345 : 344, 343, 342, 341... back down to 0 ??

The first way is breaking down the number into it's 100s, 10s, 1s place to find each individual number. The other way is decrementing the last number by 1.

Both would need a loop of some sort. Try breaking it down by hand solving smaller integers to find the mathematical "patterns" ... any repeating patterns usually require a loop.

For other problems similar to this one, it also might help to list out your variables and what value they contain as you design your loops, especially when using arrays. It might help visualize what is happening in the loops. example: var[i] in a loop, write the value of var[0] and i, then var[1] and i, then var[2] and i ... and so on. It really helps to do this with nested loops! :)

Also, some other things to think about is code format... Class names should begin with a capital letter while variables begin with lower case letters: "smoked" should be "Smoked". In larger projects, it makes the code easier for others to read.

Also, when I was starting out, a handy piece of code to add to all your projects is a while loop that allows the user to continue or quit. Then you can run your code with multiple entries.