Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to make a money change program?
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Inuyasha22




PostPosted: Wed Apr 20, 2005 8:14 am   Post subject: How to make a money change program?

hi everyone, i'm doing a money change program, like we can change USD into CND, or HKD into CND and so on, and i don't know what i should do in order to make them change money, so if there is anyone who can help me, that would be greatful, thank you~~~
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Wed Apr 20, 2005 8:25 am   Post subject: (No subject)

Well, the best way to do that would be to set a base currency. Let's say that we have 5 currencies: A, B, C, D, E.

Now, we'll assign A as the base currency: that is, all other currencies are going to be relative to A. We set the values of each currency in terms of 'how many A are they worth.'

A = 1
B = 0.4
C = 10
D = 24
E = 0.8

That is, one A is worth one A. One B is worth 0.4 A. One C is worth 10 A, and so on.

Now, let's say you want to know how many C's 5 D's are worth. What you do is convert D's into A's.

1 D is worth 24 A's, so therefor 5 D's are worth 24 * 5 = 120 A's
Now we convert from A's to C's.
1 C = 10 A
x C = 120 A

With some simple math, we determine that x = 12. Therefor, 5 D's are worth 12 C's.
Inuyasha22




PostPosted: Fri Apr 22, 2005 8:18 am   Post subject: (No subject)

the currency changes a lot, what if i want get a site that will help me change the currency i use everytime? how can i do that?
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: