Need help with a book exercise! Javascript!

Discussion in 'Javascript' started by ApDev, Oct 14, 2017.

  1. ApDev

    ApDev

    Joined:
    Oct 14, 2017
    Messages:
    1
    Likes Received:
    0
    1. The user is visiting Thailand. He or she has 65 U.S. dollars. Tell the user how many Thai baht that amounts to. Display an image of the Thai flag on the same page.

    2. My code:
      <script>
      var baht = 33.42;
      var usd = 65 * baht;
      var str1 = "$65 ="
      usd = usd.toString(usd);
      str1 = str1.concat(usd)
      str1 = str1.concat("baht");
      alert(str1);
      document.write("65 = " + "65 * 33.42" + "<br/>");
      </script>
     
    ApDev, Oct 14, 2017
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.