Loops - Reading Assignment

It allows us to write code that repeats itself until a certain condition is met.

Loops let us write shorter code, that repeat until a pre determined condition is met or until a break in the code is implemented. without meeting the conditions or having a break written in the code, the loop will run endlessly.

A do loop will always execute a code at least once and then checks if it needs to execute more times. The while loop is only going to run, if the given condition is not met in the first place.

Indentation makes our code more readable. It can be a couple of spaces or tabs.

1 Like

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 is actually what the name stands for. If you are making circles or starting from a point, taking a path to get again at the point were you left is a loop. In computing languages it is the same. When you want a program to be executed in one direction but until it finds or does what you want to do in the end, it turns back to the begining until it finds it’s true answer. So loops are actually programming scripts that do the same and the same thing all the time until they find their result.

3. What is the difference between while and do-loops?

Do-loops and while-loops are almost the same. They only have one difference. A do-loop always executes its ody at least once, and it starts testing whether it should stop only after that first execution. As in the book example with the name, if you don’t put the name inside ‘’ or `` so it becomes a string the computer will keep asking you your name.

4. What is indentation?

The role of the indentation inside blocks is to make the structure of the code stand out and be clear to read from a person. With the proper indentation, the visual shape of a program corresponds to the shape of the blocks inside it.

1 Like
  1. What is looping control flow allowing us to do?
    looping control flow is allowing us to run pieces of code multiple times over
  2. Describe what “loops” do in your own words.
    loops take user input and run them through various scenarios to get a proper end result
  3. What is the difference between while and do-loops?
    whie loops will start testing on line 1, 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?
    a way to clean up code that makes it easier to read for other programmers
1 Like

Looping control flow allows us to repeat code multiple times.

Loops make the program repeat itself several times until its executed.

While-loop checks to see if a statement is true or false,
Do-loop will always execute the code at least once.

Put some spaces or brake the line in code to make it more readable.

1 Like
  1. Looping control allows us to go back to a previous portion of the program and rerun it.
  2. Loops rerun a program until a certain criteria is met.
  3. A while loop will only run if the criteria is met. A do loop will always run one full cycle of the loop before considering the criteria.
  4. Adding spaces to the beginning of each line within blocks. It’s basically formatting code to make it easier to read and review.
1 Like
  1. Allows us run to a piece of code multiple times. To go back at some point of the program where we were before and repeat it with the updated state of the program - and variables-, and till a certain condition is met.

  2. Allows us to program repetitive tasks in a very efficient way.

  3. Do loops are like a one way or one time or one contition loops, while “while” excecute the loop as many time as the condition it introduces is met. Normally is the second part of the statement.

  4. Is a convention to keep the code clearer. It consists in adding spaces, a new line, in front of statements that are part of some larger statements.

1 Like
  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. It’s the repetition of a statement (a single thing) until certain criteria is fulfilled

3.a do loop always executes its body at least once
a while loop if the conditions are not met, it will not execute

  1. indentation is just a way to make easier to read the code but has not practical effect on it
1 Like
  1. we can create conditions to how the code is looping
  2. loops are repeatable code that can automate a lot of tasks
  3. do loops executes the hole body, before being able to stop
  4. The fact that you can format your code however you want
1 Like

1. What is looping control flow allowing us to do?
Running a piece of code multiple times.

2. Describe what “loops” do in your own words.
Running a piece of code multiple times. :slight_smile:

3. What is the difference between while and do-loops?
The do loop executes the command at least once, even though the condition inside the while loop is false.

4. What is indentation?
It is a way to write the code that is readable and understandable.
As the book says: “The role of this indentation inside blocks is to make the structure of the
code stand out”.

1 Like
  1. Run a code many times
  2. Running the code until something stops the computer
  3. ‘Do’ runs and then check
  4. The way you organize the code in order it will be easy to read
1 Like
  1. What is looping control flow allowing us to do?
    to return to a point in the program where the condition was checked and loop started, then repeat it.

  2. Describe what “loops” do in your own words.
    Loops repeat code until conditions are met

  3. What is the difference between while and do-loops?
    While loops check for a condition then execute the loop. The do loop will execute then check the condition

  4. What is indentation?
    tabbing or adding spaces(boo) to help code readability

1 Like
  1. What is looping control flow allowing us to do?
    It allows us to repeat a peice of code any number of time and then go on with the instructions after that. It allows us to create a loop that starts and ends at the same point in the control flow diagram.
  2. Describe what “loops” do in your own words.
    They execute a set of instructions again and again Untill a bolean expression that the programmer has written becomes false.
  3. What is the difference between while and do-loops?
    While loops first checks if some bolean expression returns false and then runs the set of instructions if the expression is true. And the repeat those two processes. The do loop first executes the set of expressions first and then checks if the bolean expression is true. So if switches around those two steps.
  4. What is indentation?
    it is some space that are put into each line of code in the beginning of the line. it creates a visual effect that makes the code easier for humans to read and understand. if the indentations are created in a good way.
1 Like
  1. Looping control flow allows us to go back in the program to a specific point and repeat it with our current program state.

  2. Loops keep entering statements as long as the expression gives a “true” value. They go back to check whether the program’s work is finished.

  3. Do-loops always execute its body at least once, and it keeps testing at least until the first execution. While-loops check for the condition first, and then possibly loop.

  4. Indentation is creating spaces and line spaces inside the code. It is not mandatory since the code could be read the same way even without indentation. It just makes reading the code easier and more accessible.

1 Like
  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 until the requirement is met and then it exits or let program proceed ahead.
  2. Loops allow to run a piece of code multiple times. A task is repeated until the desired result is reached.
  3. DO loops and WHILE loops are similar. The former is different just because it always executes its body at least once and it starts testing whether it should stop only after that first execution. WHILE loop saves time.
  4. Indentation is the increase or decrease of space between the left and right margin (space) of a paragraph or line or statements so that code hierarchy make sense and code becomes more readable.
1 Like
  1. Looping control flow is allowing us to go back to some point in the program where we were before and repeat it with our current program state.
  2. Loops make the piece of code to be executed multiple times with reference to current state of the program. The process will be stopped when specified criteria are met or there is a break inside the loop.
  3. The main difference is that the do loop will executed at least once,when the while loop may not execute at all.
  4. Indentation is a method of adding spaces in front of statements that are part of some larger statement. It makes the code more readable, although it is not required.
1 Like
  1. Looping control flow allows us to repeat a piece of code.

  2. Loops execute the code they contain just like normal code, but they repeat it N times, or undefined times until some condition is met.

  3. While… creates of loop and execute it after evaluating the condition, whereas Do… execute the loop and then evaluate the condition at the end of the iteration.

  4. Identation is creating space at the beginning of a line of code. By using more or less space, it allows the developper to create a visual structure, improving the code readability.

1 Like

Annotation 2020-04-18 230129

  1. Book definition tel us that by " Looping control flow allows us to go back to some point in the program where we ware before and repeat it "
  2. The purpose of looping is to execute the statement or our code over and over again . Depending on conditions we set we don’t necessary have to write the code over and over again we can set conditions for it in order to make it faster and cleaner.

The most basic loop in JavaScript is the while loop. The purpose of a while loop is to execute a statement or code block repeatedly as long as an expression is true. Once the expression becomes false, the loop terminates.


The do…while loop is similar to the while loop except that the condition check happens at the end of the loop. This means that the loop will always be executed at least once, even if the condition is false .
4. To my current understanding it’s kind of like spacing but vertical . Keeping it clean and organized consistently.

1 Like

What is looping control flow allowing us to do?
Loop structures allow you to run one or more lines of code repetitively. You can repeat the statements in a loop structure until a condition is True , until a condition is False , a specified number of times, or once for each element in a collection.

Describe what “loops” do in your own words.
A loop in a computer program is an instruction that repeats until a specified condition is reached. In a loop structure, the loop asks a question. If the answer requires action, it is executed. The same question is asked again and again until no further action is required.

What is the difference between while and do-loops?
The main difference between a while loop and do while loop is that while loop check condition before iteration of the loop. On the other hand, the do-while loop verifies the condition after the execution of the statements inside the loop.

What is indentation?
Indentation or indenting refers to Indentation (typesetting), the placement of text farther to the right, or left, to separate it from surrounding text.

1 Like
  1. What is looping control flow allowing us to do?

It allows us to go to points of code and re-execute them only if the loop conditions are true when converted to Boolean.

  1. Describe what “loops” do in your own words.

It allows us to execute code in a program then go back to the 1st line of code and re-execute the list of expressions in loop like manner.

  1. What is the difference between while and do-loops?

Do loops will execute their body at least once. The loop continues to execute until you give it a non- empty value.

  1. What is indentation?

It helps make the structure of code standout. It gives visual breaks to signal where a block ends and where it begins.

1 Like

Glenn_CostaRica

1. What is looping control flow allowing us to do?
The looping control flow allows us to not continue going below, but return to a given previous instruction in a sequence of instructions, and also allow us to keep repeating the return action until a determined value of values are verified.

2. Describe what “loops” do in your own words.
Loops help us repeat one instruction or one given set of instructions again and again until we can continue going down in the flow.

3. What is the difference between while and do-loops?
A while is a kind of loop which takes a boolean condition and keeps repeating the execution of the instructions inside the loop while the condition remains TRUE; as soon as it turns FALSE, the while loop stops. On the other hand, the do loop, which is similar, executes the set of instructions once without verifying the condition; and, it verifies the condition for the first time after the first iteration of the instructions. After that, it keeps repeating if the condition remains TRUE, and it stops when the conditions turns FALSE.

4. What is indentation?
It’s a rule associated to good practices and asthetics that makes code appealing at a visual level. It has the purpose to make code easy to see and analyze. It makes, for example, nesting very easy to verify. It is only for humans, though. Machines do not need the identation.

1 Like