Thursday, December 15, 2016

Lab 8

 In this lab we had to demonstrate our knowledge of loops. In my lab I executed loops and gave brief explanations of each one. The for loop is best for when something has to be repeated a known number of times and it is inconvenient to type it over and over. The for in loop is best when the contents of an array have to be written. The loop could write them out for you. The while loop is good for when a condition is temporary and something has to be done during the conditions current state. The do while loop is exactly the same however it ensures that the code executes at least once. 

No comments:

Post a Comment