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
    Apr 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Intro to javascript questions

    I need help with the javascript in this page. I don't know how to do what it is asking me for and I am running out of time.
    Thanks a million, RHonda



    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script>
    function numberGuess()
    {
    stringVar=prompt("Enter your guess number");


    while (stringVar<999)
    {

    }
    }
    </script>
    <script>
    function enterNames()
    {
    stringVar=prompt("Enter name");
    }
    </script>
    <script>
    function enterProducts()
    {
    stringVar=prompt("Enter product name");
    return
    }
    </script>
    </head>

    <body>
    <p>&nbsp;</p>
    <h1>WDV221 Intro Javascript</h1>
    <h3 align="center">Javascript Loops</h3>
    <p>Topics: loops, for loops, while loops, sentinels!</p>
    <p>Place all script code on this page.</p>
    <p>1. Create a function that will ask you for a number until you enter 999 which will end the loop. You do not need to display the number. </p>
    <p>2. Create a function that will ask you for a name until you tell the function that you do not have any more names. After you enter each name it will ask you if you have more names to enter. If you enter yes the process will continue. Display each name at the end of the following sentence.</p>
    <p>The name you entered is: </p>
    <p>3. Create a runtime script that will use a prompt( ) to accept how many products will be displayed. Use a for loop to display &quot;Product Name&quot; and the product number as a &lt;p&gt; element.</p>
    <p><strong>Example output:</strong></p>
    <p>Product Name 1</p>
    <p>Product Name 2</p>
    <p>...</p>
    <p>4. Create a runtime script that will use a nested for loop to create a table with 3 rows and 5 cells. Place the same number or a letter in each cell. </p>
    <p>Hint: Write a table in HTML. Do a row first then do multiple rows. </p>
    <p>5. Create a function called totalSales( ) that will ask the user to enter an amount until you enter &quot;done&quot;. Add those amounts together and display them in an alert when the user is done entering amounts..</p>
    <p>Have fun!!</p>
    </body>
    </html>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,033
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    Quote Originally Posted by MisoRhonda View Post
    I need help with the javascript in this page. I don't know how to do what it is asking me for and I am running out of time.
    Thanks a million, RHonda
    Do please read the forum rules and guidelines, especially Rule 1.5. We are not here to do your homework for you, and it is obvious that you have neglected your assignments until the very last minute.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

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