Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    unterminated string literal error

    hi, can anyone help with this, thank you so much!

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Coin Calculator</title>
    </head>

    <body>
    <script type="text/javascript" language="javascript">

    var input;
    var amount;
    var nQtrs;
    var nDimes;
    var nNickels;
    var nPennies;
    var nCoins;

    input = prompt("Please enter a monetary amount in te form XXX.XX")

    amount = parseFloat (input);
    amount = amount * 100;
    nQtrs = amount / 25;
    nQtrs = parseInt ( nQtrs );
    amount = amount - ( nQtrs * 25);
    amount = amount % 25;
    nDimes = parseInt ( amount / 10 );
    amount = amount % 10;
    nNickles = parseInt ( amount / 5);
    nPennies = amount;
    nCoins = nQtrs + nDimes + nNickles + nPennies;

    document.write( "At minimum, you need " + nCoins + " to make $" + input ' <br />);

    document.write( "Quarters = " + nQtrs + " <br />);
    document.write( "Dimes = " + nDimes + " <br />);
    document.write( "Nickles = " + nNickles + " <br />);
    document.write( "Pennies = " + nPennies + " <br />);

    </script>
    </body>

    </html>

  • #2
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can anyone try to run this and find out what the problem is plz, thank you so much for your time, i appreciate!


  •  

    Posting Permissions

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