Alliedassault           
FAQ Calendar
Go Back   Alliedassault > Lounge > Offtopic
Reload this Page JavaScript help?
Offtopic Any topics not related to the games we cover. Doesn't mean this is a Spam-fest. Profanity is allowed, enter at your own risk.

Reply
 
Thread Tools Display Modes
JavaScript help?
Old
  (#1)
da_neural is Offline
Senior Member
 
Posts: 170
Join Date: Mar 2003
Location: Australia
  Send a message via MSN to da_neural  
Default JavaScript help? - 05-29-2003, 01:19 AM

hey, anyone out there can they help me with some JavaScript @ skool my class is learning JavaScript and here is the prob we have to change this program below we have to write a program line to make it add 5 to the number. (NOTE: ALL THE JAVASCRIPT IS IN ITALIC)

<script language = 'javascript'>

var theNumber;

var theSquare;

theNumber = window.prompt("Enter a number ");

theSquare = theNumber * theNumber;

document.write("Hello. The square of " + theNumber + " is " + theSquare + "
");

document.write("Welcome to my Web page.");

</script>


and this one plz
now with this one we have to make it the program which has the computer write one hundred lines saying 'This is getting monotonous'
here is the source

<script language = 'javascript'>

var theNumber;

var theSquare;

var count;

theNumber = 20;

for (count = 0; count < 10; count++)

{

theSquare = theNumber * theNumber;

document.write("Hello. The square of " + theNumber + " is " + theSquare +"
");

theNumber++;

} //end of for loop

</script>


and also if you can the first one i have to make it print out 5 square numbers by the putting the document.write into a for loop

last one soz for this being so long we have to write a program that will allow you to calculate the squares of negative and which will continue until your enter a number greater than 0

source code
<script language = 'javascript'>

var theNumber;

var theSquare;

do

{

theNumber = window.prompt("Enter a number ");

theSquare = theNumber * theNumber;

document.write("The square of " + theNumber + " is " + theSquare + "
");

}while (theNumber > 0); //end of for loop

</script>


any help would be greatly appreciated biggrin: angel:
  
Reply With Quote
Reply



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



Powered by vBulletin® Version 3.8.12 by ScriptzBin
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBulletin Skin developed by: vBStyles.com
© 1998 - 2007 by Rudedog Productions | All trademarks used are properties of their respective owners. All rights reserved.