Question

Either using html, javascript as a function or arrays In the prior version of this exercise you converted from a particular c


Thank you in advance.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

/* See the comments */

<html>
   <body>
   <script>
           function doConvertion()
           {
               RUBLE = 74.39; // Since 1 United States Dollar equals 74.39 Russian Ruble
               FRANC = 0.91; // Since 1 United States Dollar equals 0.91 Swiss Franc
               YEN = 105.84; // Since 1 United States Dollar equals 105.84 Japanese Yen
               var inputAmount = parseFloat(document.getElementById('txtAmount').value);
               if(isNaN(inputAmount))
               {
                   alert("Enter some values")
                   return;
               }
               var showData = 'For input as Us Dollar : ' + inputAmount + '<br/>';
               var moreSpace = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp';
               if(document.getElementById("checkUS").checked)
               {
                   showData += moreSpace + 'Us Dollar : ' + inputAmount + '<br/>';
               }
               if(document.getElementById("checkRubles").checked)
               {
                   showData += moreSpace + 'Rubles : ' + (inputAmount * RUBLE) + '<br/>';
               }
               if(document.getElementById("checkFrancs").checked)
               {
                   showData += moreSpace + 'Francs : ' + (inputAmount * FRANC) + '<br/>';
               }
               if(document.getElementById("checkYen").checked)
               {
                   showData += moreSpace + 'Yen : ' + (inputAmount * YEN) + '<br/>';
               }
               document.getElementById('showOutput').innerHTML = showData;
           }
       </script>
       <h1> Currency Converter </h1>
       Type the satrting amount(in US dollars) here:
       <input type="text" id="txtAmount"><br/>
       What would you like to convert to (check off all that you want to see the convertion to)?<br/><br/>
       <input type="checkbox" id="checkUS" onchange="doConvertion()" > Us dollars<br/>
       <input type="checkbox" id="checkRubles" onchange="doConvertion()" > Rubles<br/>
       <input type="checkbox" id="checkFrancs" onchange="doConvertion()" > Francs<br/>
       <input type="checkbox" id="checkYen" onchange="doConvertion()" > Yen <br/><br/><br/>
       <div id="showOutput"></div>
      
   </body>
</html>
      
      

/* Editor screen */

/* Output of the application */

/* That's all. Thanks */

Add a comment
Know the answer?
Add Answer to:
Thank you in advance. Either using html, javascript as a function or arrays In the prior...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • As part of this assignment we are using the base Gallery HTML and writing JavaScript code...

    As part of this assignment we are using the base Gallery HTML and writing JavaScript code that will: 1) preload the images provided to us, 2) Create rollover functionality for each of the thumbnails in your image gallery 3) Use appropriate images found in the images folder. 4) Write developer comments to describe the variables being declared and explain the functions and logical blocks of JavaScript code pertaining to the gallery. I know it has to be an external JS...

  • Please answer these questions! they all are linked to one another! thank you in advance! Bob...

    Please answer these questions! they all are linked to one another! thank you in advance! Bob Beamon's long jump at the 1968 Olympics was literally "like nothing seen before. As you will see in the upcoming video he broke the world record by 57 cm (we will probably be converting that to inches in the Exercise). He would have won the 2012 Olympics long jump by a 55 cm! Bob Beamon's historic leap. Chap 6 Quiz Q1 Homework Unanswered In...

  • Could you convert this PDF to HTML format using styles for massgeneral.org ?   Here’s a...

    Could you convert this PDF to HTML format using styles for massgeneral.org ?   Here’s a good example of a page you can copy HTML from:http://www.massgeneral.org/children/turner-syndrome/turner-syndrome-mosaic.aspx. When you’re done, you can send me the HTML and I’ll pop it into a site template and we can take a look. PS You don’t have to build anything from scratch for this—it’s just about tagging the subheads and the bulleted lists, etc. and getting that “Did you know?” box into the same format...

  • If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but...

    If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • Evaluate the arical writ the response in which you state your agreement or disagreement with writer...

    Evaluate the arical writ the response in which you state your agreement or disagreement with writer up un these questions guidelines 1) can empathy lead us astrary? how 2) our heart will always go out to the baby in the well, its a measure of our humanity. but empathy will have to yield to reason if humanity is to have a future can empathy yield to reason? how? thank you The Baby in the Well: The Case against Empathy* -Paul...

  • Hello! Could you please write your own four paragraph (5-6 sentences per paragraph) take away or...

    Hello! Could you please write your own four paragraph (5-6 sentences per paragraph) take away or reflection of the below information? Please complete in 24 hours if possible. Thank you! RIS BOHNET THINKS firms are wasting their money on diversity training. The problem is, most programs just don’t work. Rather than run more workshops or try to eradicate the biases that cause discrimination, she says, companies need to redesign their processes to prevent biased choices in the first place. Bohnet...

  • Hi there! I need to compare two essay into 1 essay, and make it interesting and...

    Hi there! I need to compare two essay into 1 essay, and make it interesting and choose couple topics which im going to talk about in my essay FIRST ESSAY “Teaching New Worlds/New Words” bell hooks Like desire, language disrupts, refuses to be contained within boundaries. It speaks itself against our will, in words and thoughts that intrude, even violate the most private spaces of mind and body. It was in my first year of college that I read Adrienne...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT