Hi, any chance of a hand?
Okay,
Yes this is homework before someone says it and i dont expect an entire answer just a hint or a nudge in the right direction.
I have to make a program with two class's customer and bank.
Thats grand and the rest of the methods are fine.
However one of the methods is a conversion from euro to dollar.
My question is can I somehow import the current conversion rate from the internet instead of supplying it everytime. My lecturer said we can try and do it for extra marks so if you could point me in the right direction that would be great!
Thanks,
John
Re: Hi, any chance of a hand?
Hey,
look into httpclient and getmethod :)
use some form of inputstream and buffered reader too
Getting Started with HTTPClient may help
Good luck
Re: Hi, any chance of a hand?
May I suggest adding a third (utility) class:
Code:
public class MonetaryUnits {
public static double getDollarToEuro(double dollar) { ... }
public static double getEuroToDollar(double euro) { ... }
...
}
This way you can hide the fact how you got the conversion rate and maybe your professor gives an an extra grade for this approach ;-)
kind regards,
Jos