Loops - Reading Assignment

  1. A loop allows us to run a piece of code multiple times. A looping control flow, in particulare, allow us to go back to specific point (usually where a conditional execution was starting) and repeat it as many times as the loop will be set to do it.

  2. In my words a “loop” is a sort of mantra.
    I will go on repeating it as long as I need to get what I need (peace of mind or a certain action with a certain attitude.) In the case of the program, having the computer doing or getting to the state I wanted)

  3. In the DO function you need to repeat the action at the end of each loop until it has been said to stop.
    WHILE is checking the condition every time and will stop the LOOP depending on the condition.
    WHILE
    So DO ALWAYS EXECUTE at least one time. (keep repeating my mantra even tough it is not necessary anymore)
    WHILE EXECUTE ONLY if the condition is met (repeating the mantra only if I need to do it.)

  4. INDENTATION is not necessary, Javascript does not need it to execute and to run the instructions. To able to read Javascript we find very much easier indentations, it is like formatting a test, with commas, and line breaks.

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. a loop is a repetition of a statement, a piece of code that continues to run several times until a predetermined criteria are met. In the example of sum all even numbers from 0 until we reach the number 14. When the number 14 is reached we leave the loop and the code continues

  3. The while loop is used to repeat a statement or a group of statements while a given condition is true. It checks the condition before executing the instructions inside the loop. The do loop is similar to the while loop. But the condition is checked at the end of the execution of the statements in the loop. The important difference between while loop and do loop is that, a while loop checks the condition before the statements within the loop are executed, while a do loop checks the condition after the statements within the loop are executed.

  4. indentations in blocks are spaces at the beginning of a code to make the structure of the code stand out. In code where new blocks are opened within other blocks, it can become difficult to see where one block ends and another starts. These spaces are not really required. You could write a program as one long line if you like it, but it gives a better overview

1 Like
  1. ***What is looping control flow allowing us to do?
    A. It allows us to run a pieces of code multiple times.

  2. ***Describe what “loops” do in your own words.
    A. Loops allow us to go back to a certain point in the program and repeat the code.

  3. ***What is the difference between while and do-loops?
    A. A do-loop always executes its body at least once, and it starts testing whether it should stop only after the first execution. A while creates a loop and is followed by an expression in parentheses and than a statement.

  4. ***What is indentation?
    A.Indentation inside the blocks make the structure of the code stand out and easier to read.

1 Like
  1. What is looping control flow allowing us to do? to execute a program multiple times
  2. Describe what “loops” do in your own words. make work easier and calculations faster
  3. What is the difference between while and do-loops? while creates loop and execute it after evaluating the conidtion, do execute loop and evaluate the condition at the end
  4. What is indentation? creating space at the beginning of a line of code to help readability
1 Like
  1. The looping allowing us to go back to some point in the program where we were before and repeat it with our current program state.
  2. This is a way run a code multiple times.
    3.The Do loop differs from the While loop whit always executing it’s body at least ones, and it is start testing whether it should stop only after that first execution.
  3. Arranging the program in a way to be easier for programmer to separate the different blocks. For example if you have blocks in other blocks etc.
1 Like
  1. Permite que um programa seja executado inumeras vezes até que a condição determinada seja alcançada, diminuindo o tempo e o trabalho necessários para programar e executar.

  2. O loop é uma forma de tornar o trabalho do programador mais eficiente, reduzindo o número de caracteres digitados, economizando o tempo, diminuindo redundâncias e deixando o código mais limpo. O loop é executado ao iniciarmos uma declaração com palavras chave (While and Do), uma expressão entre parenteses, que indica os critérios para a execução do loop e uma declaração que orienta as instruções para o programa.

  3. O loop pode ser executado com algumas variações.Quando utilizamos a keyword While o loop será executado quantas vezes forem necessárias para que atinja os critérios estabelecidos na expresão referida. Ao utilizarmos a keyword Do, o loop será sempre executado em todo seu corpo ao menos uma vez até que o critério estabelecido na expressão referida seja atendido, a partir daí o loop é encerrado.

  4. Indenteção é a formatação do código, existem alguns padrões recomendados de espaçamento e quebra de linhas utilizado para tornar o código mais limpo, legível e compreensível.

1 It allows a program to be executed countless times until the determined condition is reached, decreasing the time and labor required to program and execute.

2 The loop is a way to make the programmer’s job more efficient, reducing the number of characters typed, saving time, reducing redundancies and making the code cleaner. The loop is executed when we start a declaration with keywords (While and Do), an expression in parentheses, that indicates the criteria for the execution of the loop and a declaration that guides the instructions for the program.

3 The loop can be executed with some variations. When using the While keyword, the loop will be executed as many times as necessary to reach the criteria established in the expression mentioned. When using the keyword Do, the loop will always be executed in its entire body at least once until the criteria established in the referred expression is met, from then on the loop is closed.

4 Indentation is the formatting of the code, there are some recommended patterns of spacing and line breaks used to make the code cleaner, more readable and understandable.

1 Like
  • What is looping control flow allowing us to do?
    Looping control flow allows you 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 let you go back to a certain line of code and repeat the process without writing the lines over and over and over.
  • What is the difference between while and do-loops?
    a while loop can have a condition in which it won’t execute but a do loop must loop at least once.
  • What is indentation?
    Identation is where you separate or have space in order for the person to properly identify certain sections easier.
1 Like
  1. Looping Control Flow allows us to go back
  2. Repeats a set of instructions untill spesific conditions are met
  3. do loops executed the instructions at least once
  4. The spacing in the beggining of a line of code. This helps to structure the different blocks of code to be more readable
1 Like
  1. What is looping control flow allowing us to do? Looping allows one to go back to code written earlier in the program, and repeat the code in the current program state.
  2. Describe what “loops” do in your own words. Loops allow us to reduce the amount of repetition when writing a program. This is particularly useful when working with large amounts of repetitive data, creating less work for the programmer.
  3. What is the difference between while and do-loops? A do loop always executes its body at least once, testing whether it should stop after that only after that first execution. A while loop is followed by an expression in parenthesis and then a statement which the loop keeps entering as long as the expression produces a value that reads true in boolean.
  4. What is indentation? Indentation is adding spaces in front of code lines that are part of some larger statement. Also spacing between blocks of code give structure to human eyes trying to read and decipher the code. However, it is not necessary for a functioning program.
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.
If you want something to be repeated a number of times in a row jou can do this by creating loops. As long as the (while) conditions are not met it will continue to execute the code.

3. 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 that first execution, while the while loops will always execute when the conditions are not met.

4. What is indentation?
It is the use of white spaces inside blocks to make the structure of the code stands out.

1 Like
  1. It will allow us to repeat a code block.
  2. A loop will let us return to point in a program and execute that part again.
  3. A do loop will be executed at least once but while loop will check the condition first and then it may or
    may not get executed depending on the condition.
  4. Its a manner to create structure to code.
1 Like
  1. What is looping control flow allowing us to do?

By controlling the loop flow, the loop is re-executed in its updated state until a prescribed condition is met, at which point it allows the rest of the code to continue.

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

They allow one to insert a type of circuit breaker in the code, essentially halting the remaining execution until a requirement is fulfilled.

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

A do loop will always execute at least once, as opposed to a while loop, which checks its condition first, meaning that if its criteria are met, it does not run.

  1. What is indentation?

It’s feasible to write an entire program on a single line of code, in Javascript this makes no difference to the computer. Spacing and Indentation allows for a better visual understanding of the code.

1 Like
Questions
  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. The loop keeps entering the statement as long as the expression produces a
    value that gives true when converted to 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. It is used to make the structure of the code stand out. It does not affect the program and it makes it easier to read and work on.

1 Like
  1. What is looping control flow allowing us to do?
    This allows the program to go back to an earlier point and run/repeat from there.

  2. Describe what “loops” do in your own words.
    Loops repeat until a certain condition is reached, on each iteration variables that are fed into the loop can continue to change until condition met.

  3. What is the difference between while and do-loops?
    A do loop always runs at least 1 time, a while loop may not execute at all if the test condition is already met at the start.

  4. What is indentation?
    It is a way of displaying the code so that it is easier to read and follow.

1 Like

Ok thanks @ivga80. Definitely will need to do this with the chapter 2 exercises, as I am working hard to solve the exercises.

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 until the requirement is met and then it exits or let program proceed ahead

  2. Describe what “loops” do in your own words.
    Method of iterating on the object you are able to easily access all the value pairs in the contain.

  3. What is the difference between while and do-loops?
    While loops evaluate conditions before execute the content of the loop. Do loops evaluate conditions after the block of the loop is executed at least once

  4. What is indentation?
    Indentations is spaces in the begining of lines of code to make the structure stand out. It is not necessary and only used for readability. A program can be written all in one line since the computer will not read spaces.

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 allows us to run a piece of code multiple times yet requiring less work to complete it.

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.  To reflect this, the test appears after the body of the loop.  

4. What is indentation?
Indentation is the adding of spaces in front of statements that are part of some larger statement.  The role of this indentation inside blocks is to make the structure of the code stand out.
1 Like
  1. Looping control flow allows us to go back and run a segment of code again after it has been executed.

  2. Loops use some kind of condition which if fulfilled (evaluates to true) will proceed and run a block of code. This condition will determine if the block of code is executed (or re-executed), until the condition evaluates to false (or a break keyword is used) when the loop is exited.

  3. A while loop starts by evaluating an expression, which if true will execute the following block of code (just like an if statement. However at the end of the block of code execution (control flow) will return up to the while condition and re-evaluate the expression and if still true will re-execute the following block of code. This continues until the while condition evaluates to false at which point the loop ends and the following block of code is not executed again. Note: With a while loop the block of code will not be executed at all if the first time the condition is check it evaluates to false.
    A do loop only differs in that the loop (block of code) must be executed at least once. This is because the condition to test to see if the code should re-execute occurs at the end of the block of code. The logical structure is therefore: do { block of code } while condition is true.

  4. Indentation is where blank space is used to make the structure of the code more readable and logically understandable by humans. By using indentation, code that is logically related can be grouped together (i.e. shown at the same indentation level). Note: Indentation is not required by the computer, which ignores all indentation and new lines. Code could be all on one line, with no spaces, as far as the computer is concerned.

1 Like

What is looping control flow allowing us to do?
It helps to cut down on the amount of code used to do repetitive tasks like counting or waiting
for conditions to be met while a program executes.

Describe what “loops” do in your own words.
It repeats a portion of code until preset conditions are met.

What is the difference between while and do-loops?
“While” loop keeps on looping until conditions are met
“Do” loops keeps on looping until inputs are set.

What is indentation?
Structuring of code with spacebar, linebreaks or tab button to make it more readable.

1 Like
  1. It allows to execute part of a program multiple times. Thansk to looping it is possible to go back to some point of a certain program and run it again as many times needed in order to reach a specific objective.
  2. They iterate code until some condition is met.
  3. The difference is that the do loop executes its code at least once and then decide whether to keep executing on the basis of the result. The while loop is executed only if the condition is met since the very beginning, so it won’t ever execute if that condition is not met.
  4. Is the process of inserting spaces throughout the code in order to make it better structured.
1 Like