Question

i need help with this homework web page and i need the code too Using the "do while" or the "for" contr...

i need help with this homework web page and i need the code too

  1. Using the "do while" or the "for" control statements, have a visitor to your Web page do, or see, something repeatedly. You could have him or her enter a number of months, an interest-rate, and an amount, and print out a table with the amount on deposit. Try to make the loop appropriate to the website theme that you have picked.
  2. Use a function in your Web page. You can use a user-written function that you design, or one of the provided functions in JavaScript, and you can combine Parts A and B by putting your function inside of the loop.
  3. Update your header to indicate where the loop script is located, its purpose, which function(s) are used, and where they are in your website (file and location).
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program 1:

<!DOCTYPE html>
<html>
<title> Demo </title>

<head>


<script>

function calculate() {
var amt = parseInt(document.getElementById("amount").value);
var no = parseInt(document.getElementById("noOfMonths").value);
var interest = parseInt(document.getElementById("interestVal").value);
var total = (amt * no * interest) / 100;
alert("Amount is " + total);
}
</script>


</head>


<body>

Amount : <input type="text" id="amount"> <br> <br>

No of Months : <input type="text" id="noOfMonths"> <br> <br>

Interest Value <input type="text" id="interestVal"> <br> <br>


<button onclick="calculate()"> Calculate </button>


</body>
</html>

Program 2: You need enter -1 to terminate the program

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h3>Question 2 Solution </h3>
<hr />
   <div id="total"></div>
<div id="total1"></div>
<div id="total2"></div>
<script type="text/javascript">

   var count1=0, count2=0, count3=0, userInput=0, number=0;
   while(number != -1) {
       userInput = prompt("Please enter a number");
       number = parseInt(userInput);
if(!isNaN(number)) {
       count1++;
   if(number%3==0)
           count2++;
       if(number%5==0)
           count3++;
}
}
document.getElementById('total').innerHTML = "You entered " + (count1-1) + " numbers";
document.getElementById('total1').innerHTML = "Mulitple of 3: " + (count2) + " numbers";
document.getElementById('total2').innerHTML = "Multiple of 5: " + (count3) + " numbers";

</script>

</body>
</html>

Add a comment
Know the answer?
Add Answer to:
i need help with this homework web page and i need the code too Using the "do while" or the "for" contr...
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
  • i need help with this homework webpage and code too: The webpage must include: Global Structure...

    i need help with this homework webpage and code too: The webpage must include: Global Structure Tags Text Tags Images   Your first page must be named index.html Include a table within your site, challenge yourself to add a header in the table, and choose interesting border and/or cell formatting. Include a hyperlink within your site. Include an image in your site. Include a form in your site to demonstrate understanding of a variety of form components (the form does not...

  • i need help with this web page project and i need the code too for this web page Include two or three HTML features that...

    i need help with this web page project and i need the code too for this web page Include two or three HTML features that make the website more robust, dynamic, and professional. Which features you opt to add can be discussed in the discussions. Some ideas might be to have all three types of links (internal to the page, links to your other pages, or links to other websites). Complete a Contact Us page which includes a form. Try...

  • HTML Web Page project: Need help to create a web page exactly as the example below...

    HTML Web Page project: Need help to create a web page exactly as the example below using HTML. I need the source code. Page 1 of CA272 Midterm Welcome to your name's CA272 Midterm Text In this class, I learned how to... 1. create an X)HTML web page, where I can 2. change the size of my font, 3. change the color of my fonts, 4. change my font style, 5. and change the background color of my web page....

  • I need some help in jquery or javascript. I managed to do the hover effects using...

    I need some help in jquery or javascript. I managed to do the hover effects using css and js but i can't seem to "hold" the hover effects on the default page or even after i clicked on a particular page and landed there. Am i missing something in my css or js or both? You can download the working files here together with the instructions + screenshots so that you can better understand what i am trying to describe:...

  • Fake News This exercise is about modifying the content of a page in your web browser using Javascript. As we have said, Javascript has access to the current page via the Document Object Model or DOM....

    Fake News This exercise is about modifying the content of a page in your web browser using Javascript. As we have said, Javascript has access to the current page via the Document Object Model or DOM. In your browser, the variable document represents the current document and your code can use it to read and write to the current page. In this exercise we will use the developer tools Javascript console to write Javascript to access parts of the main...

  • I need a code/ script for this problem. I am new to programming and do not...

    I need a code/ script for this problem. I am new to programming and do not really know how to approach it, it may be a loop. There is a file containing info about grocery stores A, B, C, and D. The code would split/separate the info of grocery store A alone on 1 file (AS) and all other grocery stores in another file (O). I would like the python and Javascript version of this code please Thank you.

  • Create a Web page to be used for storing software development bug reports in a MySQL...

    Create a Web page to be used for storing software development bug reports in a MySQL database. Include fields such as product name and version, type of hardware, operating system, frequency of occurrence, and proposed solutions. On the main page you display all the reported bugs (hint: use a table). Include a link at the bottom of the page which takes you to another page where you can create a new bug report. Furthermore, add a link after every filed...

  • Can someone plz help me??? I would like a website that has to do with guitars...

    Can someone plz help me??? I would like a website that has to do with guitars or something to do with music, someone asked me what kind of website I would like to have and that would be awesome. The attributes to be included, are below. I need a small website that to where I need to interlink a CSS file into the HTML file. I don't know to save the files to have to be able to run with...

  • You are planning to build a Web Site for a fictitious local organization or charity. The...

    You are planning to build a Web Site for a fictitious local organization or charity. The website should allow the visitor to subscribe to a newsletter (simulated), present past newsletters, and view images related to the organization or efforts. You need to complete the entire design phase and then implement the Web application. Please create the Word document and answer the following questions: Identify the goal of the website: Who are the end users? Why do you need to have...

  • Please I need help with MATLAB .. PLease help me . Thankyou Write Matlab code to...

    Please I need help with MATLAB .. PLease help me . Thankyou Write Matlab code to plot a 2D sinc function over a 2D cartesian grid where x ranges from 100 to 355 and y ranges from 0 to 255 and the sinc is centered at somewhere not midway in the grid. First plot the grid, and then plot the function on the grid (both as grayscale and as a surface plot). Comment the code well, generate the figures and...

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