WEB Javascript People

Discussion in 'OT Technology' started by lightsout, Nov 12, 2007.

  1. lightsout

    lightsout New Member

    Joined:
    Jan 12, 2007
    Messages:
    3,045
    Likes Received:
    0
    Location:
    Chicago/Carbondale, IL
    I have an assignment for one of my classes where I have to make a web page using javascript that converts US dollars to Euros and vice versa. Any help on how I could get started would be appreciated.
     
  2. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,914
    Likes Received:
    8
    Location:
    Los Angeles
    Do you know basic JavaScript syntax? This is a pretty simple project to complete. Did you know pay attention in class at all? Not trying to be a dick but if you know basic JavaScript syntax you should be able to slew up something like this in 5 minutes.

    How about you get started on the project, then come in here and post what you're having trouble with.
     
  3. lightsout

    lightsout New Member

    Joined:
    Jan 12, 2007
    Messages:
    3,045
    Likes Received:
    0
    Location:
    Chicago/Carbondale, IL
    Alright yeah I paid attention it's just hard because my teacher is indian and he is very hard to understand
     
  4. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,914
    Likes Received:
    8
    Location:
    Los Angeles
    :werd:

    Just get started on it and post your code telling us what you're having trouble with.
     
  5. ez4me2c3d

    ez4me2c3d Cold Member

    Joined:
    Sep 19, 2003
    Messages:
    1,836
    Likes Received:
    0
    Location:
    Minneapolis, MN
    Looks like 1 Euro is 1.4698 US Dollars ATM.
     
  6. lightsout

    lightsout New Member

    Joined:
    Jan 12, 2007
    Messages:
    3,045
    Likes Received:
    0
    Location:
    Chicago/Carbondale, IL
    Well I ended up seeing my teacher after one of my classes so I think I got it figured out

    Code:
    <html>
    <head>
    <title>Currency Converter</title>
    </head>
    <body bgcolor ="blue">
    <h1>Currency Converter
    <br>
    By: </h1>
    <script language=javascript>
    var currency;
    var amountEntered;
    currency = window.prompt('Enter 0 to convert Dollars to Euros, Enter 1 to convert Euros to Dollars','');
    currency = parseFloat(currency);
    while (currency < 0 || currency > 1)
    {
    currency = window.prompt('Please enter either 0 (USD to EUR) or 1 (EUR to USD)','');
    currency = parseFloat(currency);
    }
    amountEntered = window.prompt('Enter the amount you would like to be converted','');
    amountEntered = parseFloat(amountEntered);
    if (currency == 0 )
    {
    document.write('<BR>' + amountEntered + ' US Dollars is equal to ' + amountEntered / 1.23 + ' Euros')
    currency = parseFloat (currency);
    }
    else
    {
    document.write('<BR>' + amountEntered + ' Euros is equal to ' + amountEntered * 1.23 + ' US Dollars')
    }
    </script>
    </body>
    </html>
    I'm not sure if the conversion is right I'm confused now lol
     
  7. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,914
    Likes Received:
    8
    Location:
    Los Angeles
    Close, I think the conversion should be: 1.4698 instead of 1.23 though.
     
  8. Pepsi1975

    Pepsi1975 Mod of the Year

    Joined:
    Jan 6, 2005
    Messages:
    47,590
    Likes Received:
    0
    Location:
    Detroit
    bored? only way to explain bumping a 4 year old thread lol
     
  9. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,486
    Likes Received:
    69
    Location:
    Sparkopolis
    ban.
     

Share This Page