I am chilling at work, browsing through some code shit, since, y'know, I'm a programmer - and I came across an article on how to charge for programming work:
The essence of the article is very Computer Science oriented:
1. Break the project down into tiny functional units (divide & conquer)
2. Figure out a min and max cost
3. Only charge for hours actually spent coding (not researching)
4. Charge a higher rate for hours coding (to make up for #3)
5. Track your time coding very specifically
Makes sense, right? This way, everyone wins. You're honest with your client, you get paid well and appropriately per project, and the client gets what they ask for.