Currency Converter Currency Converter
home Student Projects no local find frame, full screen Google search web for topic jump to footer translate with Babelfish by Roedy Green ©1996-2008 Canadian Mind Products
This essay is about a suggested student project in Java programming. This essay gives a rough overview of how it might work. It does not describe an actual complete program. I have no source, object, specifications, file layouts or anything else useful to implementing this project. Everything I have to say to help you with this project is written below. I am not prepared to help you implement it; I have too many other projects of my own.

I do contract work for a living, which could include writing a program such as this. However, I don’t do people’s homework for them. That just robs them of an education.

You have my full permission to implement this project any way you please.

CurrCon neededThe CurrCon Java Applet displays prices on this web page converted with today's exchange rates into your local international currency, e.g. Euros, US dollars, Canadian dollars, British Pounds, Indian Rupees… CurrCon requires Java 1.1 or later, preferably 1.6.0_06 . If you can’t see the prices, of you if just want to learn more about CurrCon, click here for help.
In many places throughout this website I mention prices in Canadian dollars. These are mostly ball park prices of a variety of things, typically not products I sell. I need to have a way so that people could easily convert that price to their local currency. Ideally the system would remember their preferred currency and automatically display all displayed currencies in that form. They would not need to key in the from-country to-country and amount as they would with a conventional currency converter, such as the one at Oanda.

It would also be sufficient to run some batch process once a week to update my HTML and reupload it. I don’t need up to the second accurate exchange rates.

The programming is fairly simple. It could be done with CGI, JavaScript or even a Java Applet. The most difficult part is political, getting access to a file of current exchange rates. You could extract it by simulating one of the free converters, or you might make special arrangements with a company such as Oanda to let you periodically download it to your own server using their FXCommerce service.

It might be implemented much the way a hit counter is, using digit *.gifs or a numeric gif to display the value. You might use a cookie to track preferred currency. You might have a way to display/change that preferred currency either as a flag icon or as a country code and/or country name.

Oanda has implemented a scheme very similar to what I have asked for called FXCommerce that requires JavaScript and cookies. A typical convertible price has to be encoded in your HTML with JavaScript like this:

<script type="text/javascript">document.write(OANDAconvert(45.95, "USD"));</script>
They have recently added some code to hide the script to make this more difficult.

This means the price is $45.95 USD . Unlike mine, Onada is not smart enough to use your local currency as the default display. With Oanda there is no default currency and no display of the current currency country, either in words or icon. In their scheme, typically you use two columns to display, one in US$ and one in local currency that starts out saying "Convert This!" until the user selects a local currency, which wrecks the layout by being too long a string. In my scheme, you would need only one column.

Here is how you invoke my currency converter I wrote as a Java Applet:

I don’t actually write all the bubblegum, I generate it with an html macro like this:
<!-- macro CurrCon c$A CAD 2500.00 -->
Here is what it looks like on screen: $2500.00 CAD

The interesting thing about is the way all currencies on a page will flip if you change even one. See the gay glossary to see it in action.

Another way to handle this is to prepare your pages with a servlet using JSP, or displaying columns of currencies, recalculated daily. You can get a list of the day’s conversion factors by screensrapinig in from their FxDaily page.

You might try a similar but slightly simpler project first, a metric/English measure converter, so you can prepare your web pages in either metric or English units and have the viewer decide in which system they prefer to view the page. The conversions are more complex, but the conversion factors don’t change daily the way currency conversion factors do.

The main cleverness in the program is selecting a suitable unit for a particular dimension, e.g. is inches, feet or yards most appropriate for 59 cm?

The user could even invent her own personal set of measures, e.g. hands where hand is defined as the width of her hand, or strides where a stride is the length of her stride, or fingers for the volume displaced by her index finger up to the knuckle. This lets everyone satisfy Henry VIII-sized egos.

You could even invent a set of personal cooking units of measure, like the pinch and sifterful. You could compose recipes in your personal units and others could read them translated to whatever units they wanted. It would be trivial to add recipe doubling or halving to serve any number of people.

buying CurrCon
CurrCon implementation
currency
Oanda

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.17] The information on this page is for non-military use only.
You are visitor number 12,004. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/project/currencyconverter.html J:\mindprod\project\currencyconverter.html