Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-17-2012, 02:57 AM   PM User | #1
MisoRhonda
New to the CF scene

 
Join Date: Apr 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
MisoRhonda is an unknown quantity at this point
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>
MisoRhonda is offline   Reply With Quote
Old 04-17-2012, 08:09 AM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,105
Thanks: 197
Thanked 2,422 Times in 2,400 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
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.
Philip M is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:13 PM.


Advertisement
Log in to turn off these ads.