Solve this simple programming assignment
Alright, this might be a simple programming solution for most, but I would like to know what you would do the following question:
Design the logic for a module that would print number 1 through 10 along with its square and cube.
Example:
Printonethroughten()
Number = 1
While number <= 10
Print number
Number = number + 1
End while
Return
This was the example given and I assumed, one would have to do this to get the square
Printonethroughten()
number = 1
while number <= 10
print number
number = number + 1 * number
End while
Return
Cube
Printonethroughten()
number = 1
while number <= 10
print number
number = number + 1 * number * number
End while
Return
---
Was the above solution the correct answers or incorrect answers?
|