Loops - Reading Assignment

What is looping control flow allowing us to do?
Looping control flow allowing 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.
Loop is designed working cycle that allows us run the code multiple times.

What is the difference between while and do-loops?
There are similar. while loop fist check the condition, if it is true then it runs. Do loop run the body of the command first then it checks the condition to understand when to stop.

What is indentation?
Indentation is spaces or tab inside the code. The computer understand the code without indentation, however indentation helps us to understand the code better. The structure and visual of the code is much better with proper indentation.

  1. going back to a certain point in the program and repeat it with current state.

  2. a statement with the keyword while creates a loop. It means that it always comes back to this point until the programs task is finished, which means until a certain, defined state has been achieved.

  3. a do-loop executes at least once and checks at the end of the execution if another round is going to be executed. A while loop checks at the beginning and might not even execute once.

  4. an indentation is a block structure, not necessary for the code to be valid, but to be more easily 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. It works like a counter where a sequence of instructions that is continually repeated until a certain condition is reached

  2. Loop use to iterate through a list(s) or an array and bind it to a variable at a certain number of times. When a loop expression condition is met, the java-script compiler exit-condition loop and move on the next line of code. The idea of the loop is to reduce coding in your project.

  3. Contrast with the while loop, which tests the condition before the code within the block is executed, the do-while loop is an exit-condition loop if the expression or test condition is true.

  4. The role of this indentation is to make the structure of the code stand out so the next person who works on your codes can read and understanding your program easier. It is part of the coding standard.

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 that piece with the current program state. This makes it possible to have the computer do a lot of repetitive work for us to speed things up.

2. Describe what “loops” do in your own words.
Loops are pieces of code that repeat. Loops will for instance set of update a value until forever, or until a condition is met.

3. What is the difference between while and do-loops?
They do the same, however a DO loop always performs the body at least one time before it tests if it needs to stop. Both set a condition that needs to be TRUE in order to execute the loop.

4. What is indentation?
It’s a fancy way of saying you like to use tabs or spaces to make your code look nice

  1. To repeat execution of a piece of code untill conditions are met.
  2. Read answer no.1
  • “do loops” will execute at least once, no matter what conditions will later follow on
  • “while loops” will not execute if conditions are already met
  1. Indentation is kind of a formating a program code on its own, to be better readable for (different) programmers (createing some logical spaces in the code, those spaces has no functions in code itself).

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 repeat a previous action within the rules set by the programmer. It simplifies the code (shortens it) and can program in matter of minutes that what would otherwise take ages to accomplish.

3. What is the difference between while and do-loops?
A do loop is the same thing as a while loop but differs in one aspect. It always carries out the it’s action and tests afterward if it should stop or not. While (no pun intended) the while loop tests first if it needs to be executed.

4. What is indentation?
The space left within the code. It’s done to structure the code more clearly. Most software will automatically add these when coding. But they aren’t neccesary. A program can be coded using just a single line.

  1. It allows us to repeat a piece of the program until the statement is false.
    2.It halts the processes an repeat the loop until we have a result needed for the code to fulfill its purpose.
    3.a While loop will continue only after checking if true or false statement is given. Do loop run once nomattawhat…

<- intentation -> 4. Intentation is space/ visual setup for codes. not necessary, but easier on the eye.

  1. Introduce disturbances in the flow of control by using conditional and looping statements.

  2. A loop executes a code as long as the condition for the loop is met.

  3. A while loop executes the code as long as the condition for the loop is met. A do loop executes the code at least once and tests whether it should stop after that first execution.

  4. Two or four spaces or a tab in front of statements to create a visual representation of code blocks.

  1. Looping control floow allow use to get back to some point in the programe and repeat the execution according to the program current state.
  2. Loop allows us to repeat to run the a certain codes for over and over again.
  3. While loops will keep going as long as it produce a value. On the other hand, a do loop always execute the code at least once and will test whether should stop after the execution.
  4. Indentation is to make the code stnadout, like using spaces when open block.
  1. Control flow allows us to stop executing code for loops. If not for control flow loops would have been repeating it infinite number of times.
    2.Loops allow us to do repetitive pieces of program without the need to write it again and again- we can just set up value, that has to be a boolean “true” if the values in program are updated and then it will run till this moment. If we want it to be an infinite one- we don’t have to do that.
    3.While loop has the condition at the beginning(before the code) and do has it at the end. What that means that if the value that has to be true for “while” loop is true at the beginning the loop doesn’t have to be executed at all, while do will always execute at leat once because it checks the value needed at the end of its execution.
    4.Indentation is basically a graphical layout for code- we use spaces, tabulators etc to organise it rather than just keep it in one line- it’s much easier to read if it’s properly framed.

1. What is looping control flow allowing us to do?
It allows the execution of part of the program repeatedly until specified conditions are met.

2. Describe what “loops” do in your own words.
Loop allows program to be repeatedly executed based on a set of logic within a certain environment.

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

While loops first test the condition before execution, do loops execute it first and then check looping condition.

4. What is indentation?

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. looping control flows allows us to go back to a particular point in a program where we were before and repeat it with our current program state.
  2. loops repeat an action under given conditions. It is best to place thsee statements of your loops in side blocks, which are designed by braces
  3. while loops check a condition at the beginning. do loops execute a statement or group of statements and then check conditions at the end.
  4. indentation is a convention to help keep your code clean and readable. particialry,it is good to use indentation after creating a loop.

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

It allows an executing program to go back to an earlier point in the program to run a piece of code multiple times. Generally the loop will slightly modify the input upon execution as to break its initial condition; once the initial condition is broken, the program will consider the “loop” complete and move on by executing the next statement in the flow.

This whole process allows us as programers to simplify the amount of work we would’ve otherwise had to do. For example, a program that is supposed to print the numbers 1-1000 on the console would take forever to type out by hand in 1000 independent lines, but if we set up a loop, then the tedious process becomes very simple and quick.

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

Answer in 1st paragraph above.

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

While loops check the initial condition before proceeding to execute the code within the loop’s body.
Do-loops always complete the code in the body BEFORE checking any conditions. This makes it so that the do loop will ALWAYS execute the body AT LEAST ONCE.

4. What is indentation?

Indentation is spacing added to code to make it more readable. These extra spaces do absolutely NOTHING as far as functionality or execution are concerned. They just make each block of code take a uniform visual shape if done correctly, which allows the code easier to read through later. I will be using the “TAB” key every time a new of code is created.

For example, if I have an “if” statement containing a nested “if” statement, then I would first indent (1 TAB) all the code written in the BODY of the initial “if” statement…leaving the opening line declaring the if statement and it’s condition alone. The 2nd “if” statement nested within the first would be declared with a single indent (1 TAB) because it is the declaratory line of a new block. Then I would double indent (2 TAB) the body of the 2nd “if” statement to visually separate the 2 blocks of code from one another making it easier to read.

1. What is looping control flow allowing us to do?
Looping flow control allows us to revisit and/or repeat previous sections of code that have already been executed.

2. Describe what “loops” do in your own words.
We use loops for repetitive code, or when we want to recall and refer to a certain section of code at any given place inside the whole code.

3. What is the difference between while and do-loops?
While and do both create and initiate a loop. The difference is the do-loop will execute the body of the loop once, and then apply the while condition.

4. What is indentation?
Indentation is a technique to enhance the visual presentation of a code structure. Using proper indentation makes a code structure easier to look at :slight_smile:

  1. What is looping control flow allowing us to do?
    allows us to run code multiple times.

  2. Describe what “loops” do in your own words.
    loops allow us to run the same code over and over again, each time with a different value.

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

while loop execute the code when the specified condition is true

do loop first execute the code before checking it the condition is true

  1. What is indentation?
    indentation is a way of styling code structure to make them stand out.
  1. What is looping control flow allowing us to do?
    A: Looping control ow 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.
    A: Loops offer a quick and easy way to do something repeatedly.

  3. What is the difference between while and do-loops?
    A: A while statement executes its statements as long as a specified condition evaluates to true and a
    statement executes its statement right away

  4. What is indentation?
    A: The role of this indentation inside blocks is to make the structure of the code stand out.

What is looping control flow allowing us to do?

Control flow is the set of conditions for executing a section of code. Loops allow repetitive execution of the same code

Describe what “loops” do in your own words.

Loops allow us to shorten program code by executing the same code repetitively until a certain condition holds.

What is the difference between while and do-loops?

While loops check the condition at the beginning whereas do loops are similar to Repeat … Until. Do loops always execute at least once then the condition is checked at the end.

What is indentation?

Technically code could all be written on one line, but it would be difficult to see the logic and flow of program execution without indentation. The more indentation, the more restricted the scope of the code and execution. The use of indentation allows us to see where a series of statements begin and end and where they will jump out to the next set of statements.

  1. looping control flow allows us to return to a previous part of a program to repeat an operation.
  2. Loops allow us to repeat functions, greatly reducing the amount of code to write.
  3. A do loop will execute at least once, a while loop will only execute under specified conditions
    4.Indentation is for code organisation, making your program easier to follow.
  1. Looping control flow allows us to go back to some point in our program and repeat it with the current program state.
  2. A loop is a structure which repeats a particular code until a certain condition is met to exit that loop.
  3. A while loop executes a loop as long as the condition given to it is true. A do-while loop is a modified while loop, in the sense that the program is executed at least once before conditions are checked for exiting the loop.
  4. Indentation serves a purpose of making code blocks visually stand out, so that the program structure is more easily visible. However, it does not affect the functioning of the program in any way.
  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 runs a piece of code as long as there is conditions for that.

  3. What is the difference between while and do-loops?
    A do loop starts testing conditions just after the execution and therefore runs at least once.

  4. What is indentation?
    It is a way to structure blocks of code more transparently.