Tuesday, December 16, 2014

1.3.7 ForLoops

1.3.7 ForLoops







1.       Sometimes code using an iterative loop can be written without a loop, simply repeating the iterated code over and over as separate lines in the program. Explain the disadvantages of developing a program this way.
 Using this method, the code is shorter that if you were to just repeat the code over and over. Also, the code is easier to understand if other people were to look at it.


2.      Name a large collection across which you might iterate.
 You might iterate and large amount of data, such as a long list of names, or the stock in the store.


3.      What is the relationship between iteration and the analysis of a large set of data?
Iteration changes the data as needed, but the analysis of data only looks over the data.


No comments:

Post a Comment