Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2011
    Location
    Ireland
    Posts
    1
    Rep Power
    0

    Question 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

  2. #2
    Moedig is offline Member
    Join Date
    Oct 2011
    Posts
    5
    Rep Power
    0

    Default 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

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,785
    Blog Entries
    7
    Rep Power
    21

    Default Re: Hi, any chance of a hand?

    May I suggest adding a third (utility) class:

    Java 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
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 6
    Last Post: 10-20-2011, 04:39 PM
  2. if wrong input, you get a new chance
    By hreodbeohrt in forum New To Java
    Replies: 1
    Last Post: 10-18-2011, 03:07 AM
  3. Replies: 3
    Last Post: 06-11-2011, 06:51 AM
  4. Replies: 1
    Last Post: 08-09-2008, 01:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •