Please can someone help!!!
The following script fragment will produce the seven times table, as shown.
var tableNumber = 7
var thisResult = 0
for ( var tableIndex = 1;
tableIndex <= 12;
thisResult = tableIndex * tableNumber
document.write( tableIndex + " times " +
tableNumber + " is " +
thisResult + "<BR>")
} <!-- End for -->
How do I adapt the script so that it names the numbers, for example the last line of the table should be.
twelve times seven is eighty four
12 times 7 is 84
Thanx for anyone that can help me
Maybe you can try this
// Put all of the strings in an aray
var numbers = new Array("zero","one", "two", "three", ...);
After that, you can do this:
document.write( numbers[tableIndex] + " times " +
numbers[tableNumber] + " is " +
numbers[thisResult] + "<BR>")
This is just a suggestion. It may be inefficient for what you are doing, but it should work. (Sorry if the syntax for the script is incorrect)