Common Computer Science References
At the end of this lesson, you will be able to:
understand and use a loop statement
boolean expressions
loops are used to repeat the same commands, over and over again
see here
NOTE: you need a counter, to keep track of how many times you go through the loop
go over while loops:
nil
did you know:
early computers did not have processors that could multiply, only add and subtract so programmers had to write a program to do multiplication Eventually chips did have hardware multipliers.
fortunately, from math class you know that multiplication is just repeated addition
ex. 6x3 means add 6 three times or 6+6+6
create a program, using a while loop, that:
lets the user enter in a simple positive integer multiplication question
you program performs the multiplication ONLY using addition and loops
BONUS:
once you have solved it for positive numbers, let the user enter negative numbers
what do you need to change?
do the above program in PHP