Loops - Reading Assignment


#303

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.

Describe what “loops” do in your own words?

  • Loops repeat a statement as long as a certain criteria is met.

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.

What is indentation?

  • Added spaces in front of statements that are part of some larger statement.

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

It allows us to go back to some point in the program where we were before and then repeat elsewhere in the program as many times as we want using simple shortcuts.

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

It’s a form of a shortcut or codehack that allows us to make a function run over and run as far as we want it to using simple commands. It’s like if we want the sum of all the numbers from 1 through 1000, we don’t have to add up the whole thing. We just need to input some code that tells the program what we want it to do without writing it all out manually.

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

while(expression){statement}
^The loop will keep entering that statement as long as the boolean value of the expression is true

A do-loop is like a while loop, but it always do it once before asking again.

  1. What is indentation?

They are meant to making the code easier to read.


#305
  1. to go back to some point in the program where
    we were before and repeat it with our current program state.
  2. Loops are a bit of code that keep repeating them self’s
  3. The difference between them is when the condition gets evaluated.
    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.

#306
  1. What is looping control flow allowing us to do?
    It allows us to repeat a section of code until a certain condition is met.

  2. Describe what “loops” do in your own words.
    Loops provide a way to repeat the same expressions until a certain condition is met.

  3. What is the difference between while and do-loops?
    Fundamentally, they are the same. With the DO, the expression is executed before it checks the condition (the first time).

  4. What is indentation?
    Makes code more presentable and easier to follow the logic.


#307
  1. Looping control flow is allowing us to go back to a point in the program while in its current state and repeat the action in the loop.
  2. Loops allow us to repeat a segment of code multiple times for a more efficient program.
  3. the difference between while and do-loops is that a do-loop happens at least once.
  4. Iteration is the amount of times that a loop is repeated.

#308
  1. To go back to some point in the program where we were before and repeat it with our current program state.
  2. Loop is a block of commands that can be re-executed until the condition is met.
  3. Do loop always executes its body at least once, and it starts testing whether it should stop only after that first execution.
  4. Spaces and linebackers in the code. Recommended for order, so it will be convenient to read the code

#309
  1. What is looping control flow allowing us to do?
  • Looping control flow allows us to run a particular piece of code multiple times, so as to repeat a statement using a current, and modified, state.
  1. Describe what “loops” do in your own words:
  • Loops are a kind of control flow that allows a piece of code to be repeated multiple times in order to achieve a particular purpose.
  1. What is the difference between while and do-loops?
  • while loops are control flow statements allowing code to be repeatedly executed according to a (boolean) condition, and do-loops allow a piece of code to be run at leat ice, and then possibly repeatedly executed depending on whether or not a boolean condition if fulfilled by the first iteration.
  1. What is indentation?
  • indentations are spaces used to emphasise the structure of code when reading and writing. It does not affect the running of a piece of code, but makes it easier to read.

#310
  1. Looping control flow allows us to go back to a specific point we were in in the program to repeat it with our current state.

  2. Loops allow you to program a repetitive action that executes, progresses and stops based on the values you’ve input. In simpler terms, loops run a piece of code multiple times.

  3. Do-loops always execute the body at least once, and it starts testing whether it should stop only after the first execution. Besides this, there are no other differences between while and do loops.

  4. Indentation is a method used to properly organize one’s code, identifying blocks, thus making it easier to read.


#311
  1. What is looping control flow allowing us to do?
    Preform the same action multiple times with little effort.

  2. Describe what “loops” do in your own words.
    Loops preform actions till a final outcome is found. Loops can contain if statements and be simple counters or preform complicated functions.

  3. What is the difference between while and do-loops?
    Do loop must execute at least 1 time. While executes based on it’s predefined requirements.

  4. What is indentation?

It is the use of tab to create parent and child processes visually to make code easier to read.


#312
  1. What is looping control flow allowing us to do?
    Create a program and run through it. After the program is finished running, it goes back to the top and start over again on the same program. This allow us to run a program on autopilot until some conditions are met that breaks the loop.

  2. Describe what “loops” do in your own words.
    Create a program and run through it. After the program is finished running, it goes back to the top and start over again on the same program. This allow us to run a program on autopilot until some conditions are met that breaks the loop.

  3. What is the difference between while and do-loops?
    While loops use 7 lines of code and for loops uses 4 lines of code. They do the same thing. They check the condition and see if it is true or false. If it`s true, then they will increase or decrease the value and start the loop over again. A do loop always executes its body at least once, and it starts testing whether it should stop only after that first execution. So the difference being that in the do loop you first check the body of the loop, then check if the condition is true. In the while loop you first check the condition, then check the body of the loop.

While Loop:
Int i;
i = 3;
while(i>10) {
print (i);
i++;
}

For Loop:
For(I = 3; I > 0; i++) {
Print (i);
}

Do Loop:
Int I = 0;
do {
Print (i);
i ++;
} while (i > 0);
}

  1. What is indentation?
    When opening a block and closing it we want to use indentation to show where one block/program end and where the next one starts. This is to better get a visual picture and better overview of the coding. It can get messy quick so we use spaces to differentiate the statements etc.

#313
  1. Looping control flow lets us go back to a point in the programme and repeat an action with it’s current state.

  2. It’s the repeat of a given action until a certain criteria is met. For example if we wrote a loop to count to 10 we may ask it to add 1 to the the current value until the value 10 is reached.

  3. While loops checks the current condition and then executes it’s action, do loops execute their action before checking the current state.

  4. indentation is the structure of spaces and lines in code in order for a human to read it more easily. Computeres don’t care about the arrangment of the code only that it is written in a certain order.


#314

1. What is looping control flow allowing us to do?
Loops allow us to run a piece of code multiple times, going back to some point where we were before and repeat it with our current program state
2. Describe what “loops” do in your own words.
Loops repeat an action several time, using the newly created outputs from the program. So the program will take X, apply a function to it to create Y, then take Y and apply the same function to create Z and repeat that until the defined boundary. The boundary is found by the program when the output created can be converted to true when compared to the expression in parentheses in the while expression, or when the break condition is found. Loops are a JS native feature that are triggered with the keyword “while”.
3. What is the difference between while and do-loops?
Both while and do will trigger a JS Loop for your program. However, do will always execute its designed function once before checking whether the conditions are met to stop executing the loop. While will check right away.
4. What is indentation?
It is the addition of spaces or tabulations in front of lines of codes, inside of statements for example. While they are optional, they are a good way to make the structure of the code standout.


#315
  • 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.

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

Loops allow a segment of code to be repeated (without duplicating the code) while a certain condition holds true

  • What is the difference between while and do-loops?

While loops check the conditional statement before execution and do-loops execute once prior to checking the condition

  • What is indentation?

Spacing that allows blocks of code blocks to be visually grouped together. This makes maintenance and understandability easier.


#316

1- Looping control flow allows us to repeat a piece of code multiple times until we reach the desired result.
2- Loops repeat some code execution as long as a condition is met, One interesting thing with loops is the possibility of modifying a variable each time the code repeats itself.
3- To be honest, I didn’t quite understand the do loop and how it differs from the while loop. Maybe the writer was trying to say that, even if the first result of the while loop turns out to be false, the program will run at least once before stopping.
4- Indentation is the usage of space and line breaks in between statements, to make it easier to work with the code.