Computer Science Canada

Turing using Loops with Variables--Please Help

Author:  unicorn-ellie [ Sat Nov 16, 2013 10:20 pm ]
Post subject:  Turing using Loops with Variables--Please Help

Hello. I am a student taking ICS and we have been given an assignment to write a program that outputs a 10 line 7 times table starting at any number entered by the user. I had some experience with loops, but only for graphic purposes. (I know for x: 0..10 etc.)

I have already set up input variables and output variables. (Input Variable: Type-int, Name of Variable-num, Declaration Statement-var num: int) & (Output Variable: Type-int, Name of variable-answer, Declaration Statement-var answer: int, Processing-answer:= 7*num)

It would be great help if you can explain to me how to do this chart (Sorry, I couldn't really draw the chart properly!):

Loop Trace

Loop Variable | Output Variable
_________________________
Value | Equation

Author:  Raknarg [ Sat Nov 16, 2013 10:27 pm ]
Post subject:  RE:Turing using Loops with Variables--Please Help

Have you thought about using for loops within for loops? One loops controls the row and the other controls the column


: