Qbasicnews.com

Full Version: Currency Converter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Wondering if Ne one can help me. thinking of making a currency converter. that can convert one currency. in to number of different currency e.g.

GBP to EUR
EUR to GBP
EUR to Dollar
Dollar to EUR
GBP to DOLLAR
DOLLAR TO GBP

THX
We arn't gonna do it for you so if you want some tips on code you have to try =P

You can have it that you enter what to convert to and from and then enter currency
like
(psuedo)
Code:
PRINT listofcurrencies
INPUT currencytoconvertfrom
INPUT currencytoconvertto
PRINT currencytoconvertfrom*currencyconversionrate
First try to do it from one currency to another. Then you can go ahead with all currencies. Post some code so we can help ya out.

Anonymous

if youre talking about keeping it accurate then... im pretty sure youd have to update your prog every day. but if not, the easiest way would be to have one value (say dollars, hmm) as 1, and then every other currency just a ratio off of that. then to switch between the values you could just divide the ratios by each other and multiply by the result of the division of said ratios.


im purposely trying to make it hard for you. its prolly hw
In order for your currency converter to continue to be accurate, you're going to need to maintain an Exchange Rate File which contains an updated exchange rate for every currency that your program handles.

So, you need to have 2 programs:

1) Update the Exchange Rate File. (You could do the updating of this text file manually.) Be careful that the exchange rates are all current and make sense. Example: if I convert 15 dollars to EUR, then if I convert 15 dollars to GBP and that value to EUR, I should get the same result as the dollars to EUR with perhaps a minor difference in the thousands decimal position.

2) The program which computes the equivalent value of an amount in one currency to the value in another currency. This program needs to read the Exchange Rate File. If you're lazy, you could embed the Exchange Rate File into the program, and recompile the program every time a rate changes.
*****