Some charge per object... but if you know how long it will take you then go with that, keep in mind that most project change as they progress so if you think it will take 40hrs quote 60
It depends on the size and complexity of the programming. If you're just looking a simple program then I guess it could be done on that basis. The alternative is to assess the complete job and then offer a fixed price.
Depends on your area and the industry, when I work for the electronics industry I charge more then I do when I am working for the fruit, there are a couple reasons why...
1) because they expect it
2) I have to drive further
3) I have a worked in the electronics for 15 years and 3 in the fruit
4) etc
If you charge x per hr then you will faster on the easier jobs and you will be charging less
I also charge less for jobs that I do not know what I am doing (happens a lot)... I have a customer wanting me to work on a Wonderware system, I will be learning as I go so I am charging less per hr, if it was RSView I would be charging more because I would be much more productive as I know the software MUCH more.
THE KEY... make money, make enough to cover your bills and to put a few dollars into savings, you will need it for a rainy day or to re-invest into your company