The document discusses loop control structures in programming, specifically focusing on while, do while, and for..in loops. It explains how these loops allow for repeated execution of code based on conditional expressions. The document also outlines the syntax and functionality of each loop type.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
4 views15 pages
Loop
The document discusses loop control structures in programming, specifically focusing on while, do while, and for..in loops. It explains how these loops allow for repeated execution of code based on conditional expressions. The document also outlines the syntax and functionality of each loop type.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15
More Control Structure
Loop Control Structures: while, do
while, for..in Objectives: ● Create corresponding loop statements to represent the iterative process. ● Use while, do while, and for..in statements to repeatedly execute codes. What is a loop? While writing a program, you will encounter a situation where you would like to perform an action over and once again. We are just going to look at the while, do while, and the for..in statements in this learning module. while loop repeats a statement or sequence of statements as long as they are evaluated by a given conditional expression to a truthy value. while loop In general, a conditional expression contains a variable whose value in the statement code is modified by one or more statements. Each time the statements finish executing, the expression is reevaluated. do while executes a statement or statements once, then repeats the execution as long as it evaluates the true value of a given conditional expression. do while syntax for..in Loop The for..in loop is a more concise way of iterating over an object's properties. The for...in loop will run for all of the object's elements, and its syntax will be in the next slide.