Results 1 to 19 of 19

Thread: stuck, help!!

  1. #1
    static is offline Member
    Join Date
    Jan 2014
    Posts
    9
    Rep Power
    0

    Default stuck, help!!

    ok as you can tell by my profile am pretty much new to the forum and to java in general. and i mean i don't understand a lick of it or how everything is suppose to come together. i have attached the problem file and the file that shows where i am at. beyond what i have coded already i have no idea where to go from there, so am hoping the forum can help me with this and to actually learn something at the same time because i really do want to know how to code. also this is done in bluej program

    stuck, help!!-problem.jpg stuck, help!!-stuck.jpg
    Last edited by static; 01-30-2014 at 01:06 AM.

  2. #2
    static is offline Member
    Join Date
    Jan 2014
    Posts
    9
    Rep Power
    0

    Default Re: stuck, help!!

    anybody? just to be clear am not looking for people to help me code this, just a bit of explanation as regard to the problem. how am i gonna learn anything if another person does the work for me
    Last edited by static; 01-30-2014 at 02:39 AM.

  3. #3
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Default Re: stuck, help!!

    Next time for your code please copy and paste into code tags. As for what to do next Id start with creating your UI is this done as a normal program or does it get entered into the command prompt
    With the right know how, anything is possible

  4. #4
    static is offline Member
    Join Date
    Jan 2014
    Posts
    9
    Rep Power
    0

    Default Re: stuck, help!!

    actually blue j just compiles and runs it. doesn't really have a UI it all text based

  5. #5
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Default Re: stuck, help!!

    Alright Im not sure what blue is but you need a way to see what they have the currency in and then what they want it transferred to
    With the right know how, anything is possible

  6. #6
    static is offline Member
    Join Date
    Jan 2014
    Posts
    9
    Rep Power
    0

    Default Re: stuck, help!!

    bluej is a IDE, suppose to be easy to use for beginners, but so far it sucks

  7. #7
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Default Re: stuck, help!!

    lol Do you have to use it?
    With the right know how, anything is possible

  8. #8
    static is offline Member
    Join Date
    Jan 2014
    Posts
    9
    Rep Power
    0

    Default Re: stuck, help!!

    yea unfortunately. thing am having issue with is how to code the variables i guess.

  9. #9
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Default Re: stuck, help!!

    What exactly do you mean by codeing the variables
    With the right know how, anything is possible

  10. #10
    static is offline Member
    Join Date
    Jan 2014
    Posts
    9
    Rep Power
    0

    Default Re: stuck, help!!

    for example, if some one wants to find out how much a certain amount of dollar would be in euros or in yen. i have to be able to able to give them the accurate answer in converting dollars to each of those currencies in the fields

  11. #11
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Default Re: stuck, help!!

    first write a function that finds what type of currency they want to start with
    With the right know how, anything is possible

  12. #12
    static is offline Member
    Join Date
    Jan 2014
    Posts
    9
    Rep Power
    0

    Default Re: stuck, help!!

    would it be something along these lines

    public CurrencyConverter(double amount, long currency);
    {
    if(currency == 'dollar')
    {
    pound = 0.60289 * dollar

  13. #13
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Default Re: stuck, help!!

    What is the pound. I would have to variable 4 variables input number,input currency , output currency,output number. Don't wanna spoon feed you code. Plus I gotta go. Bye
    With the right know how, anything is possible

  14. #14
    AlexGraal is offline Señor Member
    Join Date
    Jan 2014
    Posts
    168
    Rep Power
    0

    Default Re: stuck, help!!

    Am I missing something here?

    Why do you have this?

    Java Code:
    public CurrencyConverter(double amount, long currency);
    {
    if(currency == 'dollar')
    }
    First of all, if currency is a long, then how can it be equal to dollar? Am I missing something?

    Second of all, if that's your function, you'll want to get rid of the ";" and add brackets...

  15. #15
    mbschutlz97 is offline Member
    Join Date
    Jan 2014
    Posts
    30
    Rep Power
    0

    Default Re: stuck, help!!

    Here's an example that you can base your code off of... this is a simple program that will convert us dollars to other currencies.

    Java Code:
    public class CurrencyConverter{
       private double pound = 0.60289;
       private double yen = 102.80;
       private double euro = 0.73176;
       private double naira = 161.455;
       
       public void convert(double amount, String to){
          if (to.equals("pound")){
             double type = pound;
             System.out.println(amount + " US dollars is worth " + (type * amount) + " pound.");
          }
          if (to.equals("yen")){
             double type = yen;
             System.out.println(amount + " US dollars is worth " + (type * amount) + " yen.");
          }
          if (to.equals("euro")){
             double type = euro;
             System.out.println(amount + " US dollars is worth " + (type * amount) + " euro.");
          }
          if (to.equals("naira")){
             double type = naira;
             System.out.println(amount + " US dollars is worth " + (type * amount) + " naira.");
          }
       }
    }

  16. #16
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,767
    Rep Power
    5

    Default Re: stuck, help!!

    Not realistically of course, exchange rates change from day to day ;)

    But if you want to be helpful you really have to wonder what use it has to dump code and not provide any kind of explanation about it. The problem here is that the OP does not know enough yet to be able to produce it himself, you have to help him to get there. Imagine that you want to help someone learn <insert your native language here>, does it help then to give them a piece of text in <your native language> ?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  17. #17
    static is offline Member
    Join Date
    Jan 2014
    Posts
    9
    Rep Power
    0

    Default Re: stuck, help!!

    Quote Originally Posted by gimbal2 View Post
    Not realistically of course, exchange rates change from day to day ;)

    But if you want to be helpful you really have to wonder what use it has to dump code and not provide any kind of explanation about it. The problem here is that the OP does not know enough yet to be able to produce it himself, you have to help him to get there. Imagine that you want to help someone learn <insert your native language here>, does it help then to give them a piece of text in <your native language> ?
    ditto, the only thing i really know how to do as far is just create field and class, which is easy for any person to do. as i said i know nothing about programming. we were just giving a particular problem and have this and that in it and just make it compile and work

  18. #18
    static is offline Member
    Join Date
    Jan 2014
    Posts
    9
    Rep Power
    0

    Default Re: stuck, help!!

    keep getting, unexpected type, required: variable found: value in this section of the code. can somebody tell me what am doing wrong
    Last edited by static; 01-31-2014 at 01:44 AM.

  19. #19
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Default Re: stuck, help!!

    Whats your updated code
    With the right know how, anything is possible

Similar Threads

  1. Re: I'm new and stuck, please help :(
    By leader111 in forum New To Java
    Replies: 2
    Last Post: 09-25-2012, 10:38 PM
  2. I'm new and stuck, please help :(
    By XoVoX in forum Advanced Java
    Replies: 6
    Last Post: 07-15-2012, 07:48 PM
  3. I'm stuck help!!!
    By nobody58 in forum Advanced Java
    Replies: 2
    Last Post: 03-18-2010, 02:52 PM
  4. Stuck in sea
    By programmer_007 in forum JDBC
    Replies: 1
    Last Post: 09-17-2009, 04:00 AM
  5. Im on my last lab!!!! And im stuck...:(
    By clanboru15 in forum New To Java
    Replies: 5
    Last Post: 03-13-2009, 01:44 AM

Posting Permissions

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