I've read lots of books for various programming languages, Java, Python, C, etc. I understand and know all of the basics of the languages and I understand algorithms and data structures. (Equivalent of say two years of computer science classes)

BUT, I still can't figure how to write a program that does anything useful.

All of the programming books show you how to write the language, but NOT how to use it! The programming examples are all very basic, like build a card catalog for a library or a simple game or use algorithms, etc. They dont't show you how to develop complex programs that actually do anything useful!

I've looked at open-source programs on SourceForge, but they don't make much sense to me. There are hundreds of files in each program and thousands of lines of code. But how do I learn how to do this? There's nothing in any book I can buy on Amazon that will give me the tools to write any of these programs.

How do you go from reading Introduction to Java or Programming Python, or C Programming Language, etc.. to actually being able to say, I have an idea for X program? Is this how I go about developing it?

It seems like there is so much more involved in writing a program than you can learn in a book or from a class. I feel like there is something.

How can I be put on the right track?

Building more complex programs comes with experience.  When I first programmed I thought I was doing well if it was over 25 lines long (and I had to use the scroll bar)  Now I write hundreds of lines a day for years on the same project application.

You might find this page interesting "Teach Yourself Programming in Ten Years" http://norvig.com/21-days.html

BTW: It is very hard to start a program.  A writer might call it "writers block".  Instead I suggest you start writing code and improve it.  Don't be afraid to delete large sections which don't do what you need.  Start again, this time you will write with a better idea of what you are doing. Start again and you will find you didn't need half the stuff you wrote last time.  When an author writes a story, it takes a long time, a lot of writing and rewriting etc. lots of reviews and feedback and its only finished when it has to be published (released)
