Jump to content

Online Calculator to determine the Value of Something


hargz

Recommended Posts

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.

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

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.

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;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.