Writing a program is like writing pretty much anything else. It starts with an idea, and then boom. The rest is easy, because you probably already have the tools in place; so you set up a project and... :) well... it is usually easiest to just build the GUI... then the rest flows from there :)