Text Parsing Power

Parsing is an activity that programmers are often reluctant to do themselves. That’s because parsing can be a real pain in the rump. Not only that, but why write your own function when you can use specific libraries that handle the job for you? That’s a blessing, but it won’t let you escape from attempting this month’s Exercise.
Continue reading

Defensive Input

The task is rather simple: Prompt the user to input a value between 1 and 9. If you’ve read the first few chapters of any of my For Dummies C programming books, you could do that one easily. But what happens when the user doesn’t type a value in that range or — worse — they type text instead?
Continue reading

Merry Cumulative Song Exercise

In my C programming books, I often use the directions on a shampoo bottle as an example of basic programming:

1. Lather.
2. Rinse.
3. Repeat.

Another real-life example of programming techniques happens in music. Specifically, cumulative songs are representative of loops. This type of song includes 99 Bottles of Beer and the holiday favorite, The Twelve Days of Christmas.
Continue reading

Plotting Squares

The term sounds terrifying, but it doesn’t need to be: Data analysis is the process of using code to examine data and come up with some sort of conclusion. Obviously it helps to know the type of conclusion before you write the code. Only in science fiction does someone say, “What do you make all of those seemingly boring numbers, Mr. Computer?”
Continue reading

Spelling Alphabet

The spelling alphabet is a tool used by the military, police, and other professionals. It helps them to sound cool when they spell names. You’ve probably attempted to spell that way yourself, even if you didn’t know any official spelling alphabet. Lots of people say, “N as in Nancy.” That’s how the spelling alphabet works.
Continue reading