hargz Posted December 15, 2008 Share Posted December 15, 2008 Hi, Can someone help me make a calculator like on Nextworth.com Would really appreciate it. How would i go about making it? Thanks Sam Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/ Share on other sites More sharing options...
Maq Posted December 15, 2008 Share Posted December 15, 2008 Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/#findComment-715887 Share on other sites More sharing options...
hargz Posted December 15, 2008 Author Share Posted December 15, 2008 Anyone else? ??? Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/#findComment-716239 Share on other sites More sharing options...
corbin Posted December 15, 2008 Share Posted December 15, 2008 You have to at least try.... Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/#findComment-716245 Share on other sites More sharing options...
hargz Posted December 15, 2008 Author Share Posted December 15, 2008 Hi, I don't even know where to begin! How would you make one? Thanks Sam Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/#findComment-716267 Share on other sites More sharing options...
ok Posted December 16, 2008 Share Posted December 16, 2008 sam why not study php first. http://php.net/ Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/#findComment-716287 Share on other sites More sharing options...
Daniel0 Posted December 16, 2008 Share Posted December 16, 2008 Right... I see the people above decided to be really helpful... Say somebody wanted to sell you a lightly worn, 8 GB, black 1st gen iPhone with charger, USB cable, and a headset. How would you figure out what you wanted to pay for that? If you don't know that then you won't know how to teach a computer to figure it out either. Here is how I would do it: Have a base price for each model. Each of the other things you can select between will modify the price. E.g. a broken item could decrease the price by 60% where light wear would only decrease it by 15%. Whether it's black or white doesn't affect the price, so it won't alter it. This is essentially the decorator pattern. Also, I'll move this to app design. Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/#findComment-716296 Share on other sites More sharing options...
hargz Posted December 16, 2008 Author Share Posted December 16, 2008 Hi, I have my values as follwoing: Each iPod on a different size has a base price. For example a Nano 8gb and a Nano 4gb Have a different price. Then the colour does not effect the price of the iPod. The standard trade in condition is NW which is the base price EX condition has a +10% value and HW has a -10% value. I understand all my values, i just need to know how to make a form that enables me to show the values that change. I have placed the values of all the iPods in an excel spreadsheet and with the values of the added items such as headphones etc. Thank you for your help. Sam Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/#findComment-716545 Share on other sites More sharing options...
corbin Posted December 16, 2008 Share Posted December 16, 2008 Right... I see the people above decided to be really helpful... Say somebody wanted to sell you a lightly worn, 8 GB, black 1st gen iPhone with charger, USB cable, and a headset. How would you figure out what you wanted to pay for that? If you don't know that then you won't know how to teach a computer to figure it out either. Here is how I would do it: Have a base price for each model. Each of the other things you can select between will modify the price. E.g. a broken item could decrease the price by 60% where light wear would only decrease it by 15%. Whether it's black or white doesn't affect the price, so it won't alter it. This is essentially the decorator pattern. Also, I'll move this to app design. Awkward..... I thought it was just a normal calculator. Didn't realize it was a pricing calculator. I didn't bother looking at the site when I saw no code posted. Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/#findComment-716892 Share on other sites More sharing options...
hargz Posted December 16, 2008 Author Share Posted December 16, 2008 any tips to help make this? Thanks Sam Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/#findComment-717103 Share on other sites More sharing options...
Daniel0 Posted December 16, 2008 Share Posted December 16, 2008 You could use the decorator pattern like I said above, or you can do something like this: <?php $basePrice = 100; // determine this based on the type of model if ($_POST['condition'] == 'NW') { $basePrice *= 1.1; // add 10% } // etc. echo $basePrice; ?> Quote Link to comment https://forums.phpfreaks.com/topic/137072-online-calculator-to-determine-the-value-of-something/#findComment-717114 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.