Timeline for Week 2 walkthroughs ages.c has a bug?
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 11, 2015 at 18:15 | comment | added | Cliff B | Remember that this code goes inside the outer for loop because it is collecting a series of ages and putting them in an array. You have to test twice. The IF test is to determine whether to print an error message and the second, the while condition, is to go back and get new input. Skip the if test and no error message. Skip the while test and you keep the bad data. | |
Jul 11, 2015 at 17:27 | comment | added | Ashish Patel | can I know why it is twice validating ages once using if statement, then again using do...while? can if part be skipped? | |
Apr 22, 2015 at 22:56 | comment | added | Cliff B | If you're satisfied, can you mark the question as answered? Let's keep up on forum housekeeping. ;-) thanks. | |
Apr 22, 2015 at 22:21 | comment | added | macchiato15 | Thank you! This helped! | |
Apr 22, 2015 at 18:13 | history | answered | Cliff B | CC BY-SA 3.0 |