Computing.Net > Forums > Programming > Java Currency Converter Application

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Java Currency Converter Application

Reply to Message Icon

Name: asf135
Date: April 14, 2004 at 18:33:36 Pacific
OS: XP
CPU/Ram: N/A
Comment:

I am trying to figure out how to use java 4 my class... our assignment is to learn java and figure out how to do some type of mathematical equation in the application... i decided to do currency. I have tried to read up on java but i cant find really any good sources to get started. Any one willing to help or give me some sites that i could use to understand this stuff. if it helps i am using notepad and html to run it.
Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: wharfie
Date: April 15, 2004 at 00:55:22 Pacific
Reply:

A very good place to start is Sun's Java Tutorial at

http://java.sun.com/docs/books/tutorial/index.html


0

Response Number 2
Name: gpp
Date: April 15, 2004 at 05:26:08 Pacific
Reply:

In particular, check out the NumberFormat class...

http://java.sun.com/j2se/1.4.2/docs/api/java/text/NumberFormat.html


0

Response Number 3
Name: asf135
Date: April 15, 2004 at 16:12:59 Pacific
Reply:

thanks those will help i think :)


0

Response Number 4
Name: asf135
Date: April 15, 2004 at 17:00:18 Pacific
Reply:

that site didnt help very much after all i guess i have no clue when it comes to java so i am just going to ask what to do.
Here is what i have:
<form name=currencycounter>
Enter the U.S. dollar amount here:<input type=text name=dollar size=6>
<input type=button value="Yen"
<input type=button value="Pound"
<input type=button value="franc"

i am trying to make it when you enter the number in american currency into the box it then hit a one of the buttons to convert it into the other currency it will return the results. what should i do from here?


0

Response Number 5
Name: gpp
Date: April 16, 2004 at 06:22:25 Pacific
Reply:

Ok, I see what you're doing. The NumberFormat class will only parse strings and format numbers. You will need to do the conversion yourself. Heres a site I found that has the conversion rates...

http://www.angus.co.uk/haggis/currconv.html

Use this to parse the number the user inputs..

Number myNumber = NumberFormat.getCurrencyInstance(Locale.US).parse("$123.45");

and then from there you can do the conversion and print it back to the user.


0

Related Posts

See More



Response Number 6
Name: asf135
Date: April 18, 2004 at 08:59:47 Pacific
Reply:

awsome thanks for the help


0

Response Number 7
Name: asf135
Date: April 19, 2004 at 17:57:56 Pacific
Reply:

<html>

<head>
The Currency Counter
<title>
The Currency Counter
</title>
</head>

<body>
<script language = "Javascript">
var Yen = 0.00921;

var Pound = 1.788

var Franc = 0.7714
</script>

<form name = "currency counter">

Enter the U.S. dollar amount here:
<input type=text name=dollar size=6>
<input type=button value="Yen">
<input type=button value="Pound">
<input type=button value="Franc">
</form>
</body>
</html>

//Goals:;
//user type in dollar amount and translate it into the other currency.;
//if the user puts in somthing that is not valid have it say it is not a valid number.;


Here is what i have now i am not sure how to plug in that suggestion. i was thinking it might have something to do with onclick but then i am lost


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Java Currency Converter Application

Java Temperature Converter www.computing.net/answers/programming/java-temperature-converter/13171.html

different menu currency converter www.computing.net/answers/programming/different-menu-currency-converter/6580.html

C currency converter www.computing.net/answers/programming/c-currency-converter/6504.html