Thursday, January 22, 2015

1.3.7: For Loops

1.3.7:  For Loops

Hangman Game:


Lottery Ticket Game:



1. Repeating the code in this way would slow down the program significantly. Having all of those extra lines of code would take a long time to go through, an although the code would function the same, it would slow down the processes, wasting resources. The extra lines would also cause the program to be bigger, which isn't a big deal with small programs, but with a larger piece of software, the size difference would be immense.

2. If you were processing large amounts of data from a single source, such as sales from a store in a chain, loops like this would be much easier to update sales and maintain live updates from stores.


3.      Since iterations do the same actions on every piece of data they receive, processing a large amount of data that needs the same operations performed on each piece, iterative loops are the most efficient way to do this

No comments:

Post a Comment