website design pricing calculator
Wednesday, September 8th, 2010
Can anyone create a price calculator in Java?
Hi! I’m trying to create a price calculator for custom-made picture frames to post on my website. I want users to be able to type in the length and the width into a table and then it displays the estimated price. There are three different frame thicknesses; 1.5″ Narrow Barnwood, 2″ Rustic Barnwood, and 3″ Thick Barnwood, so a drop-down menu or something that would let users choose the design would be awesome. I came up with an equation that will do the trick.
First we find the square area of the frame by multiplying the perimeter (length+length+width+width) by the thickness of the frame (which will either be 1.5″ 2″ or 3″). Then we multiply the square area by either 0.27 if its 1.5″ Thick, 0.23 if its 2″ Thick, or 0.18 if its three inches thick. Then the calculator should add five dollars for a custom made fee.
So it is as follows: [2*(l+w) *Thickness] * 0.27 if its 1″ Thick, 0.23 if its 2″ and 0.18 if its 3″ thick. Then $5 is added to the final price for a custom fee.
I’m not exactly sure what you wanted when you asked this. So I did a little very simple mockup that will hopefully answer you question. You can make it far more complicated but I hope this helps.
Sorry the cut off code so you might have to concatenate some lines above this if you have questions let me know.
And here is the form I used, again its very basic but it works.
Again this can be a lot more complicated and limiting. I would suggest you get additional code to handle people trying to put XSS in your website etc. You might also want to limit people putting in number that are too small or large for you to handle.
Taxi prices calculator, online booking system for taxis and private hire cars
