Loops - Reading Assignment


#242
  1. Looping control flow allows us to execute the same piece of code multiple times.
  2. Loops execute a statement while a certain condition is met.
  3. A while loop evaluates a condition before running, while a do loop executes once before evaluating a condition to determine whether it should carry on.
  4. Indentation lays out the structure of the code and makes it more readable.

#243
  1. What is looping control flow allowing us to do?
    Allows us to repeat statements and command blocks

  2. Describe what “loops” do in your own words.
    Loops execute blocks of code multiple times until stipulated conditions or values are met

  3. What is the difference between while and do-loops?
    do loops execute the code at least once before checking conditions while while loops check conditions before executing

  4. What is indentation?
    Indentation is like “paragraphing” and “spacing”, allowing you to better organize your code and make it easier to be read.


#245
  1. Looping controls flow by allowing us to repeat a script over and over again without having to re-write the script for each repetition when the script contains more than one statement. Controlling the flow of the script is necessary because of the way statements are executed from top to bottom.
  2. A loop is defined as something that winds, curves or encircles. In JavaScript the loop is not visible as a loop. Instead it is a statement of code that loops around and around. It is within the syntax of the code that the loop is structured and directed to control the flow.
  3. The while loop in the code points to a duration of an expression. That is, how long will the loop continue. The Boolean expression’s value dictates the extent of the loop when the expression is no longer true.
    The do loop is usually used with the while loop and is considered a control flow statement. It differs from the while loop in that it must execute its requirement at least once before the code can continue. There is something that must be done before the loop can continue. The while loop has no such requirement and that is how the two loops differ.
  4. Indentation has to do with how the written code is structured. It has little to do with how the computer reads code. In essence it makes the code more readable for yourself and for others. Sometimes code editing programs will help with the indentation. What is important is that there is consistency in the structure to identify the placing of the code blocks.

#246
  1. A way to run a piece of code multiple
    times. This form of control flow is called a loop.
  2. a do while loop is a control flow statement that executes a block of code at least once, and then repeatedly executes the block, or not, depending on a given boolean condition at the end of the block. (thanks to google and Wikipedia :wink: ) … o yeah and Ivan who tells us to use Google :slightly_smiling_face:
  3. The most important difference between While and Do-While is that in Do-While, the block of code is executed at least once.
    i.e., the Do-While loop runs at least once, even though the condition given is false

While- your condition is at the begin of the loop block, and makes possible to never enter the loop.
In While loop, the condition is first tested and then the block of code is executed if the test result is true.
4. Indentation is the space between blockes of code wich make it more readable.


#247

Just one question Ivan.
I watched your video about Loops in Javascript.
Why the he… would we want to use Loops in a website? Can you find one website where a sentence is repeated a hundred times… or 3, 5 or whatever.

Loops in Exel i would understand but on a website… please explane.

Greetings from The Netherlands… bye the way… i love your shows at 8:00 AM.


#248

Number one use for loops on Webpages is when you retrieve a list of data from your server and want to display it as rows in an element on the page. But there are plenty of others as well.


#249

What is looping control flow allowing us to do?

It allows us to break the normal control flow top to bottom and move back to repeat steps already completed.

Describe what “loops” do in your own words.

Loops allow repetitive code to be repeated over and over while being updated by updated bindings within the loop.

What is the difference between while and do-loops?

They are similar except that the do-loop will always complete the loop at least once, before testing for a break situation.

What is indentation?

Indentation is used to make you program more readable by using tabs or spaces, allowing you to easily see the start and ending of blocks.


#250
  1. What is looping control flow allowing us to do?
    Just like it sounds, it allows us to loop a code, which is running a code multiple times.

  2. Describe what “loops” do in your own words.
    Looping is basically running a code multiple times until a certain requirement is met. Depending on the code, you can make the program do various things, or do nothing at all, until a requirement is met.

  3. What is the difference between while and do-loops?
    The difference is that a while loop wont execute if a requirement is not met, while do-while will execute atleast once before checking the condition.

  4. What is indentation?
    Its a way to keep the code more structured and readable and make it stand out.


#251
  1. Looping control flow allows us repeat a set of code with updated information.

  2. Loops are pieces of code that are executed multiple times over and over until a certain criteria is met

  3. With do loops, the code is executed first then the expression is checked, with while loops, the expression is checked then only is the code executed.

  4. It is a way to visually structure code so you can clearly see the flow in which the code will be executed.


#252
  1. A looping control flow makes it possible to repeat a piece of code with a new value .
  2. A loop is a repetition of an event (or a set of events) with a new value until the desired result is achieved.
  3. A while loop will go on until it reaches the desired result. A do loop will run at least once before it starts testing its condition (so before it essentially becomes a while loop).
  4. A means to structure your code visually…

#253

Quite helpful, thanks :wink:


#254
  1. Looping control flow allows us to go back to a point in the program and repeat it with a different value.
  2. A loop is a tool allowing us to run a code (or a piece of code) multiple times.
  3. A “do” loop always needs to execute at least once.
  4. Spacing the statements accordingly in order to get the code more organised, making it easier to check upon it.

#255
  1. What is looping control flow allowing us to do?
    I found “THE” best definition for this in which helps me understand the overall process of looping control flow. To me, it’s almost like a process/decision flow :
    a. Sequencing – do this THEN this THEN this…
    b. The Selection – if, unless, switch, case, …
    c. Iteration – for, while, repeat, until, …
    d. Procedural Abstraction subroutine call
    e. Recursion – meaning that a function calls itself as a subroutine and allows the function to be repeated several times. I personally had an issue with this since I accidentally programmed an infinite loop which crashed my browser.
    f. Nondormancy – do this OR this OR…that is, choose one
    g. Concurrency – do multiple things at the same time.

  2. Describe what “loops” do in your own words.
    Loops are used for running the same code over and over again.

  3. What is the difference between while and do-loops?
    a. While Loops – is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while loop can be thought of as a repeating statement.
    b. Do-Loops – while the do loop is also a part of the control flow statement, it executes code at least once, and then repeatedly the block, or not, depending on the given Boolean condition at the end of the block.

  4. What is indentation?
    For Javascript coding, indentation is technically not needed, but it does helps a structured/organized way of reading the code. This is important since in most cases the programmer is working with a team on a project. You will want others to read and make sense of your code…in short, easy to understand.


#256

1.Looping control flow allows us to go back to some point in the program where we were before and repeat it with our current program state.
2. Loops allows us to run a piece of code multiple times.
3. The difference between a while and do-loop is that a do loop always executes its body at least once, and it starts testing whether it should stop only after the first execution.
4. Indentation allows the structure of the code to stand out.


#257
  1. What is looping control flow allowing us to do?
    Looping control flow allows us to go back to some point in the program where we were before and repeat it with our current program state.

  2. Describe what “loops” do in your own words.
    loops gives us the ability to run a line of code multiple times until certain criteria are met.

  3. What is the difference between while and do-loops?
    do loop always executes its body at least once and begins to test whether it should stop only after the first execution.

  4. What is indentation?
    Indentations allow us to structure blocks of code to make it stand out, this makes it is easier for the programmer to determine when one block ends and another begins.


#258

1. What is looping control flow allowing us to do?
Looping control flow allows us to go back to some point in the program where we were before and repeat it with our current program state

2. Describe what “loops” do in your own words.
The loop keeps executing some code until its value is not true

3. What is the difference between while and do-loops?
A do loop is a control structure similar to a while loop. It differs only on one point: a do loop always executes its body at least once, and it starts testing whether it should stop only after that first execution

4. What is indentation?
Adding spaces in front of statements that are part of some larger statement.


#259
  1. Looping control flow is the ability to return to some point in the program and repeat it with the current program state.
  2. Loops give the ability to repeat a command without rewriting code over and over again…saving time, finger energy and loopiness of the brain.
  3. A while loop creates the loop.A do loop is similar to while, except it always executes it’s body at least once and starts testing whether it should stop only after the first execution.
  4. Indentation is a spacing practice used to make code reading more organized and easier to read (making the structure of code more clear). Some writers can use four or fives spaces for the next line of code, while others may use the Tab button.

#260

What is looping control flow allowing us to do?
_looping control flow allows us to to go back to some point in the program where we were before and repeat it with our current program state. _

Describe what “loops” do in your own words.
loops read and execute the program line by line and then go back to the start if a certain criteria has not been reached. EG a variable does not equal to a certain value yet. then the program starts again until it gets to that value

What is the difference between while and do-loops?
a do loop always executes its body at least once, and it starts testing whether it should stop only after the first execution

What is indentation?
these are the spaces that you leave between brackets and inside blocks. They allow you to read the code more easily


#261

What is looping control flow allow us to do?

Looping control flow allows us to go back to some point in the program where we were before and repeat it with our current program state.

Describe what “ loops” do in your own words.

A loop is a function that continues to revisit the original statement and execute it as long as the boolean value is still true.

What is the difference between while and do-loops?

A while loop continues to execute the statement as long as the boolean value is true and a do loop is a function that executes first and then checks if the statement is true.

What is indentation?

The role of indention is for visual organization and to make certain code stand out.


#262
  1. it is allowing us to repeat the control flow for a specified set of commands until a certain condition is met in order to stop the loop. It also allows us to write simpler code that repeats itself and that can be altered in just one place, in contrast to copying and pasting the same command over and over again and having to alter it on every single instance it was used.
  2. loops are repetition functions that keep performing a certain set of commands until a condition is achieved to stop the loop and resume the program
  3. A do loop is a control structure similar to a while loop. It differs only on one
    point: a do loop always executes its body at least once, and it starts testing
    whether it should stop only after that first execution. To reflect this, the test
    appears after the body of the loop.
  4. indentation is the spaces used before a line of code to visually assist the coder and show the hierarchy of the program, allowing one to easily know what block of data is inside another block of data.