Need help with a book exercise! Javascript!

Joined
Oct 14, 2017
Messages
1
Reaction score
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>
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,104
Latest member
LesliVqm09
Top