I am trying to get the user to input a number, then input another number that will begin the multiplication table for the first number entered and continue on incrementing by one until the last number the user was prompted for is reached...
for example, if the user was to enter 10, then 1, then 10, the output would look like:
10 * 1 = 10
10 * 2 = 20
10 * 3 = 30
...
10 * 10 = 100
What am I doing wrong?
Thanks for the help!
function multiplierz(numberMultiplied, amountToMultiplyFirst, amountToMultiplyLast)
{
while (isNaN(numberMultiplied) = true || isNaN(amountToMultiplyFirst) = true || isNaN(amountToMultiplyLast) = true)
{
alert("YOU DID NOT ENTER ONLY NUMBERS. WAY TO GO DUMMY.");
var numberMultiplied = prompt("Please Enter The Number to Multiply");
var amountToMultiplyFirst = prompt("Start multiplying by which number?");
var amountToMultiplyLast = prompt("End multiplying by which number?");
}
for (counter = amountToMultiplyFirst; counter <= amountToMultiplyLast; counter++)
{
document.write(numberMultiplied + " * " + counter + " = " + numberMultiplied * counter + "<br />");
}
}
//Begin Program Below
multiplierz(prompt("Please Enter The Number to Multiply"),prompt("Start multiplying by which number?"),prompt("End multiplying by which number?"));
</script>