1 Replies - 1513 Views - Last Post: 09 June 2014 - 08:00 PM Rate Topic: -----

#1 romeorulez  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • 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  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • 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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1