# Ideas with how to start a calculator project

Page 1 of 1

## 1 Replies - 3593 Views - Last Post: 09 June 2014 - 08:00 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=348038&amp;s=54e1cd58d6fc4edb6d51540c2bd8f2cc&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 romeorulez

Reputation: 0
• Posts: 8
• Joined: 03-November 09

# Ideas with how to start a calculator project

Posted 02 June 2014 - 09:53 PM

I am going to build a calculator that calculates shipping from point A to point B. Only thing tricky is that there are a lot of locations and depending on distance there is a cost associated.

There is a flat rate for shipping + the distance rate. The distance is as follows (just an example):

Places Japan Korea Sweden Germany Spain
Japan .5 .6 .7 .8 .9
Korea .4 .5 .6 .7 .8
Sweden .5 .6 .7 .8 .9
Germany .5 .6 .7 .8 .9
Spain .5 .6 .7 .8 .9

So to ship from Japan to Sweden would be .7 or to ship from Spain to Korea would be .8.

What are my options on how to create this? An efficient way.

I was thinking about creating an array.
Japan = (.5,.6,.7)
Also, how would I get the values when the user selects Point a Japan and point b Korea from a drop down menu?

I was also thinking about creating a data table (editable one because these values might change), if user selects Japan and Korea, I would have a loop to find what corresponds? How would I do this?

Using asp.net
Any ideas would be helpful thanks a bunch!

Is This A Good Question/Topic? 0

## Replies To: Ideas with how to start a calculator project

### #2 romeorulez

Reputation: 0
• Posts: 8
• Joined: 03-November 09

## Re: Ideas with how to start a calculator project

Posted 09 June 2014 - 08:00 PM

Forgot to comment here but I coded this few days ago now.

Started coding and found out that arrays would be too much of work. There was about 20 locations. Which means I needed to make an array for Japan(19), Sweden(19) and so on. Thats so much work and not efficient.
Thought about multi dimensional arrays so I could set it up like a table, but again so much hard coding.
Made an access db with the data(it was in a spreadsheet) which was prettry simple. Connected the db and used SQL statement to get the data.