Computer Science 131
Introduction To Computing
Fall Semester 1997
Food For Thought
- Can you think of situations were you use loops in your everyday thinking?
- How many times would your name print out if you used the for loop:
for i in [-5..5]?
- Why does this work but for i in [1..-5] doesn't?
- Can you hvae the loop in part a print out:
by chaning what is inside the [ ] of the for loop?
- Can you have the wedgie from part d print upside down? I.e. Print the row with height o's in it first and the row with 1 o in it last?
- In part a will the procedure points ever fill in the entire rectangle? If you how many passes through your loop do you think it would take? Does it depend on the size of the rectangle? Explain?
- Is it possible to watch more than one variable at a time?
- Is it possible to watch combinations of variables like i+j, or i-2? Could this ever be useful?