Output:
Repetition
Repetition
Repetition
Repetition
Repetition
Repetition
Repetition
Repetition
Repetition
Repetition
Repetition
Repetition
etc.
Yes, I think you get the idea: we formally started our Repetition unit today! First we learned about infinite loops - loops that can go on forever, and have no natural end. Of course, there aren't many uses for infinite loops in our lives, so usually we avoid them. But did you know Apple Inc's headquarters are at 1 Infinite Loop (get it, one infinite loop?). Funny.
Anyways, next we looked at the keywords loop, exit when, and end loop. Loop and end loop make up a loop body. In the loop body, there can be zero or more statements. To avoid an infinite loop, the keywords exit when are used - they instruct the computer to exit from the loop when a pre-defined boolean expression yields the value true.
For homework, we have to do Repetition assignments 1 and 2, as well as modify assignment 2 so that the user can choose the integers in the times table.
This whole new concept is sure to add another twist to our programs!
Hey, I actually understood that due to my previous shallow experience with programming.
ReplyDeleteBTW, you ->2<- are posting at a crazy rate. Wish the same could happen on GU. But this probably takes up a lot of time, so no complaints.
@ Halalcohol; I'm really trying. i have some rough posts on my iPod, but no time to edit and post them on GU. Plus, our teacher says we have to post every day we have class. D; Sorry.
ReplyDeleteOh. I thought it would just be "post whenever you feel like it. Just don't disappear for a week." And that's ok cause it encourages me to post more. My goal is three times a week. I don't know how long it will last.
ReplyDeleteSorry, but I've been pretty busy so I haven't had much time to write on GU... and like Grace said we should be posting everyday on here. Hopefully I'll be able to write more soon, if I can find the time and inspiration.
ReplyDelete