Concept
Why are loops useful for automation?
"Computers are really good at automation. A key aspect of automation is the ability to repeat a process over and over on different pieces of data until some condition is met. For example, if we have a collection of numbers and we want to find their sum we would iterate over each number, adding it to a total, until we have examined every number. Another example may include sending an email message to each student in a course. To automate the process, we could iterate over each student record and for each student we would generate and send the email. Automated repetition is where loops come in handy. Computers are perfectly suited for performing such repetitive tasks."
Related Ideas
- What are enhanced for loops in Java?ComputerScienceOne · Enhanced For Loops
- How do you compute a summation with a for loop in C?ComputerScienceOne · Summation
- How can a for loop calculate the sum of numbers from 1 to 10?ComputerScienceOne · Nested Loops
- How can you simulate a foreach loop when iterating over an array in C?ComputerScienceOne · Other Issues
- How does PHP use foreach loops to iterate over array elements?ComputerScienceOne · Foreach Loops
- What are arrays used for?ComputerScienceOne · Arrays, Collections & Dynamic
- What do the do-while and foreach loop algorithms cover?ComputerScienceOne · Computing Tax Credit with If-Else-If . . . . . . . . . . . . . . . . . . . . .
- Why are computers dependent on human problem solving?ComputerScienceOne · Introduction