PDA

Click to See Complete Forum and Search --> : I NEED HELP!!!!!!!!!!!!!!!!!!!!!!


JDGS
Aug 13th, 2000, 01:38 PM
I need to make some "programs" in JavaScript...

1. A program that "calculates" a person age.
2. A program that "write" the first 50 multiples of 3.

Also..........

How can i know if a string is a text or a numeric one?
How can i "write" text a document already loaded?

Thanks

Aug 13th, 2000, 02:26 PM
<script>
function MultipleOf(Num)

{

var OldNum=Num;

for (i=1; i<51; i++)

{

document.write(Num + " ");

Num += OldNum;

}
}


function AgeFromYear(TheYear)

{

var NewYear = 2000 - TheYear;

document.write("you are " + NewYear + " years old");

}

</script>




[Edited by denniswrenn on 08-13-2000 at 03:36 PM]