Loops - Reading Assignment

1. What is looping control flow allowing us to do?
It goes back to a point in the code and runs through it again with the new value (result from last run though)

2. Describe what “loops” do in your own words.
repeat an if statement multiple times until a stated point

3. What is the difference between while and do-loops?
‘while’ loops only run and continue to run, while a condition is true. ‘do’ loops are similar but will run through once first and then check whether they have to run again (so will always run through at least once).

4. What is indentation?
It makes it easier for humans to read the code as connected items will be ‘nested’ in a hierarchy.

1 Like

What is looping control flow allowing us to do?

This allows us to return to a point in the program where it was before and repeat it with the current program state.

Describe what “loops” do in your own words.

Loops are iterations of the same program, continuously executed until a condition is met.

What is the difference between while and do-loops?

A while loop can break on the first condition whereas do loops always execute the first iteration and then check to see if conditions have been met or not.

What is indentation?

Indentations are line breaks and how you space out your code to see where certain blocks begin and end.

  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 allow us to repeat performing some code until a certain condition is met.

  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?
    Indentation is adding spaces in front of statements that are part of some larger statement. These spaces are not required—the computer will accept the program just fine without them. The role of this indentation inside blocks is to make the structure of the code stand out. With proper indentation, the visual shape of a program corresponds to the shape of the blocks inside it.

  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. Repeat an action until a certain output
  3. Do loops normally have a set number of repeated steps.
  4. Just spaces or “tabs” to make code/text easier to read
  1. LCF is allowing us to have a pridictable order of execution of lines of code.
  2. Loops allow for a way of condensing perhaps a large repetiion of similar lines of code into a command that repeats and checks for condition changes/and or implements changes after each loop, for example the increment function. In the words from eloquent javascript “Looping control flow allows us to go back to some point in the program where we were before and repeat it in our current program state.”
  3. A while loop checks for a condition and will execute as long as a condition is met, whereas a do loop does execute once no matter what and tests to keep going or stop after the first execution
    4.Indentation is an optional step to help the structure of the code stand out.

What is looping control flow allowing us to do?

  • repeat a piece of code depending on the conditions

Describe what “loops” do in your own words.

  • repeatable blocks of code

What is the difference between while and do-loops?

  • The while loop executes a block of code as long as a specified condition is true
  • The do/while loop executes a block of code at least once, before checking conditions

What is indentation?

  • tabs or spaces before a line of code to provide an organized structure

niceeee, please keep sharing

  1. it allows us to go back to a certain part of our program and repeat it as often as we want
  2. with loops we can repeat specific parts of our program as often as we want (e.g. 1000 times) without having to write the specific part of the program 1000 times.
  3. a while loop has the condition check before the body. In a do loop, the condition check comes after the body, so the “first round” of the loop is guaranteed to be executed.
  4. using spaces to structure your code and make it more readable
  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. A loop is created with a statement that begins with a loop keyword, such as while. As long as the value of the expression is ‘true’ converted in Boolean, the program keeps entering that same statement that begins with that loop keyword, untill the value of the expression is false, converted in Boolean.

  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.

  4. The role of indentation inside blocks is to make the structure of the code stand out.

  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. Runs same code many time.
  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.
  4. The role of indentation inside blocks is to make the structure of the code stand out.
  1. Looping control flow allows us to repeat execution of some piece of code until certain conditions are met.

  2. Exactly what I said above.

  3. It is possible that the piece of code in a while loop does not get executed if conditions are already met. Do-loop will execute the code at least once because evaluation is at the end of the loop.

  4. Indentation is a way of making code more programmer friendly bu using spaces or tabs to indent code to the right.

What is looping control flow allowing us to do?
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.
they perform actions that you want to happen over and over again until the state you are looking for is reached

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

What is indentation?
The role of this indentation inside blocks is to make the structure of the
code stand out. so that you can read it better.

Looping control flow allows the program to return to the some previous point in the program and repeat it, using the current program state.
Loops run a piece of code multiple times if an expression is true.
Do-loops always execute its body at least once and it starts testing whether it should stop only after the first execution of the program, unlike WHILE which starts testing immediately.
Indentation makes code more clear to read, understand and edit.

  1. Perform a section of code repeatedly without actually duplicating the code.
  2. Iteratively execute a block of code until (or while) a condition is met.
  3. While tests the condition before executing the loop - which may never execute. Do executes once then determines whether to execute it again.
  4. Indentation is a way to format your source code to visually represent the different levels of loops and conditions for the benefit of the person reading the code.

1. What is Looping Control Flow allowing us to do?
This 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.
They are used when we want to do something several times to save us rewriting the same code.

3. What is the difference between ‘while’ loops and ‘do’ loops?
while loops -test whether the second condition (binding) has met its parameters and if not it updates and repeats.

do loops -always executes its body at least once and it starts testing whether it should stop only after that first execution.

4. What is Indentation
The role of indentation inside blocks is to make the structure of the code stand out.

This makes it easier to read which is important for

  • larger programs to stay organized
  • if someone should take over your project
  • working in collaboration with another person or team
  1. Looping control flow allows us to go back to a previous point and repeat an instruction with our current state/value(s).

  2. Loops allow us to repeat an action a specified number of times or until a specified condition is met.

  3. The difference between “while” and “do” loops is that a “do” loop executes the instruction once before checking the condition to see if it should stop.

  4. Indentation is a tool to make code more readable for humans.

  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. A loop is a form of control which helps us to repetitively execute a script until we want to (until the condition is respected).
  3. While executes the code only if the condition is respected, Do-loops execute the code one time and then verifies the condition to be respected. I other words they do the same thing, the only thing that differs is the order Verification->Execution vs Execution->Verification
  4. Indentation = code alignment
    The role of indentation is to help people read, check and modify the code easier.

1.to go back to some point in the program where we were before and repeat it with our current program state.
2.loops actually use to avoid the repetition of operation
3.The diffrenece is at only once: 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. the structure of the code stand out

What is looping control flow allowing us to do?
It allows us to repeat a set of statements until a condition becomes true
Describe what “loops” do in your own words.
Loops circle around, it keeps repeating until the repeating is stopped by the user or if a condition is met
What is the difference between while and do-loops?
A while loop first evaluates it’s condition, a do-loop first executes the code inside the loop and then evaluates the condition. So in a do-loop the code inside the loop is executed at least 1 time
What is indentation?
To make your code more readable you can add some spaces before you start typing in the next line

  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. When a program code is written within a loops, this looped-in code part will be executed several times from bottom line up to the top line, until a condition given in the beginning doesn’t apply anymore, or the “break” command sets in.
  3. Do-loop executes first, then checks the condition. Thus it always will be executed at least ones. Whereas the While-loop first checks the condition, and then - if the condition is valid - executes the looped-in code.
  4. Moving the code text of encapsulated commands further to the right for better reading and understanding of the code.