Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Programming help

Name: Nobledragon 2006-09-10 16:38

Hi,

This is my first time posting to a 4Chan text board so i apologize if i seem a bit selfish asking for help in my first post but this is the only board that im confident has frequent users.

Here is my question:
For a homework assignment in C/C++ i need to have some code that will terminate the program if the user inputs a value outside of a preset range. Ive looked through the book and all the class notes i have and cant seem to find any reference on how to make that happen. I know someone here should be able to give me an idea on how to do this.

Name: Anonymous 2006-09-18 5:06

>>38
Lol, here's a student repeating what his programming 1 teacher told him believing it's the absolute truth in the Universe.

A good programmer will use the right tool for the right job, and break (and continue) is the right tool so many times for a number of reasons like avoiding duplicate code (duplicate code is a bad thing), simplifying loops, or not making your function wider than taller because of fugly indentation, plus a few purist causes in where you'd like to break rather than to indent differently code that works at the same level or in a similar set of cases. Even goto has its uses in languages when you can't break twice or low-level language when you need to achieve some extremely cunning hack there's no good way without.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List