Loops - Reading Assignment

Loops

  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 some code as long condition is true.

  3. a while loop will execute when condition is true. in a Do loop you run code at least once and check in bottom if condition is true or false

  4. Structuring your code in a organised way we can read and adjust the code easily. By adding spaces and comments for example
2 Likes
  1. Looping control flow allows us to go back to a point in the program, where we were once before, and repeat the code with the current program state.

  2. Loops allows part of a program to be executed numerous times in a row, until specified conditions are met. Loops are a more efficient way to write code that requires certain steps to be executed repeatedly.

  3. While loops will test the condition first and if condition is met, will execute the loop. Comparatively, do loops execute the body first and then tests the condition to determine if it should continue to execute the loop.

  4. Indentation is creating space in front of statements that are part of other statements. Indentation keeps the code neat, tidy and easy to read, especially if you are sharing the code with other people.

  1. it allows to go back in the code to executet again within the new enviroment.
  2. loops are simply here to execute a simple pice of code over an over again.
  3. a do-loop will always execute at least once
  4. indentation is used to make the written code more readeble.

What is looping control flow allowing us to do?

  • Reuse code to repeat steps or tasks over and over until a condition is met.
    Describe what “loops” do in your own words.
  • Process that is repeated until conditions are met.
    What is the difference between while and do-loops?
  • Do loops are always executed at least once then until a condition is met, while loops are run only if the condition is satisfied.
    What is indentation?
  • Typically tab or set number of spaces to assist in code readability.
  1. It allows us to go back to some point in the program where we were before, and repeat it with our current program state
  2. “Loops” run a piece of code over and over again, until the condition established in the expression is no longer fulfilled
  3. A while loop keeps entering the statement as long as the expression produces a value that gives true when converted to Boolean. On the other hand, do loop starts wondering if should continue entering the statement, only after it executes its body at least once.
  4. Indentation is a way of making the content of the block more easy to read.
  1. Is allows us to keep executing the same statement or return to it as many times as we want.
  2. A loop is simply walking in circles inside the code. You do enough laps inside that particular circle before meeting the conditions to move forward
  3. A while loop executes the code until a goal is met, a do-loop picks a path depending on the conditions you get in.
  4. Is a little space we give to a part of a code to have certain order. Similarly than when we write a text in paragraphs and give them a space depending on its relevance and content.
  1. It allows for the code to be repeated based on certain looping conditions.
  2. Loops make the code check to see if certain blocks of code should be repeated based on a defined condition.
  3. While loops only execute and continue looping when the set condition is true. Do loops execute the loop and then checks the condition to see if it should continue.
  4. Indentation helps organize your code and make blocks stand out better for readability.

What is looping control flow allowing us to do?
It allows us to repeat operations until a condition is met.
Describe what “loops” do in your own words.
Loops check a condition, perform an operation, and increment a controlling varible
What is the difference between while and do-loops?
The main difference is that do loops will run at least once before it checks a conditional
What is indentation?
indentation makes code more readable. it formats blocks in a way that is clearer.

  1. Looping control flow allows programmers to run a piece of code multiple
    times.
  2. Loops help us to run the same code over and over again, as a result, the code is cleaner and easier to read.
  3. 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 if the condition is true.
  4. Indentations or spaces in front of statements helps us to make the structure of the code stand out.

Chapter 2
WHILE AND DO LOOPS

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

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

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

  4. What is indentation?

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

Send us back to the beginning of our program/re-use code multiple times, building on the previously developed state.

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

Applies the same instructions over and over again on different data sets/and or when the previous loop iteration altered our current state.

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

While implies we will start a loop. While will continue running the code until a certain parameter is reached.
Let X = Y; While + ( condition to run until X becomes something) { print/do something to the current state; alter the current state of X}
Loop continues to run until the condition turns to false.
Do will continue attempting the loop indefinitely until it gets an initial response. Initial attempt is always made, unlike while statement which required the conditions to be met.

For loops can also be used:
For ( let var = x; continue until x reaches a certain value; do something to x each loop round){console.log(x);}
For – define a binding initialize – check if the loop continues – update the loop.

  1. What is indentation?

Where you press the tab button and the line indents.
Indentation is not necessarily required; the code will run fine without it. However, it helps with organising structure.

1 - It allows a program to repeat a block of code
2 - Loops are a flow control tool that allows a program to repeat a task many times over
3 - while loops only execute if the test condition is true. do loops always execute at least once
4 - Indentation are spaces added to the code to make the code structure look nicer and easier to read/follow

1.Looping controls allow us to repeat a piece of program depending
on the condition given.

2.Loops are statements with a syntax which are used to repeat a piece of program.

3.In While loop the statements inside flower brackets are executed only if the condition
is true whereas in Do while the statements inside the braces are executed atleast once
and then the condition is checked.

4.Giving proper spaces to statements present in program to make the look of the program more
appealing is indentation.

Reading Assignment - Loops

Eloquent Javascript Book Chapter 2 starting with WHILE AND DO LOOPS

  • 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.
    • A loop repeats the same process over and over until it reaches a set or calculable limit.
  • What is the difference between while and do-loops?
    • A while loop evaluates the limit first and then does the process, giving the possibility that the process may not be done even once, while a do loop does first and then evaluates the condition to see whether it will continue for another round.
  • What is indentation?
    • In Javascript indenting code is just a way to make code readable and understandable for the humans who need to write or edit the code.
1. What is looping control flow allowing us to do?
	a. A loop allows us to repeatedly execute a chunk of code so long as certain conditions are met.
2. Describe what "loops" do in your own words.
	a. Loops execute repeatedly until a certain condition is met.
3. What is the difference between while and do-loops?
	a. While loops check for the condition before running the chunk of code.
	b. Do loops execute the chunk of code first, and then check the condition to see if we should run the chunk of code again.
4. What is indentation?
	a. Indentation is a best practice that allow us to format our code for easier readability
  1. What is looping control flow allowing us to do?
    Execute a particular piece of code zero or more times while a certainly condition applies, while changing and/or accounting for those conditions while it runs

  2. Describe what “loops” do in your own words
    They repeat a piece of code for a potentially infinite number of times, allowing the programmer to ‘run through’ data in a flexible way. For example running through datasets for as long as there is data

  3. What is the difference between while and do-loops?
    A 0 or 1 difference: a do-loop always runs the following code at least once and then checks the condition, where a while-loop only executes the code if the condition is found to be true beforehand.

  4. What is indentation?
    A code formatting practice, enabling more readable code

What is looping control flow allowing us to do? Looping allows the repeating of steps of the program using the current state
Describe what “loops” do in your own words. Loops reduce the amount of coding necessary by allowing the repeating of steps of a program until a chosen condition is met.
What is the difference between while and do-loops? While loops check for the loop condition at the beginning of each loop and therefore may not be executed, whereas do-loops are executed at least one time.**
What is indentation? Indentations are spaces at the beginning of the lines of code that help with the programmer visualize structure of the program.

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

Allows us to repeat an action with a new value for a given variable that’s used within a loop.

  1. Describe what "loops" do in your own words.
    

Repeat the same function over and over until a condition is met.

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

While loops will execute if a condition is met. These loops may not execute if the condition is not met.
Do loops will always execute at least one time no matter what.

  1. What is indentation?
    

indentation refers to how you structure your code to look. You can use spaces or tabs to indent your code to make it more readable.

What is looping control flow allowing us to do?
Looping control allows us to repeat a set of code
Describe what “loops” do in your own words.
Loops repeat a set of code if a condition is true
What is the difference between while and do-loops?
While loops only execute if a condition is True and a do loop executes onces and if the condition is true it executes while the condition is true
What is indentation?
Indentation are the spaces in the begining of the line of code to give the code structure and make it more understandable

What is looping control flow allowing us to do?

A looping control flow allows the programmer to repeat a repetitive task multiple times without having to type it out multiple times.

Describe what “loops” do in your own words.

Loops iterate over a code block indefinitely or until a set condition is met.

What is the difference between while and do-loops?

While loops check if the condition is met, and then fire code within the block until the condition is met. Do-loops fire the code within the block before checking if the condition is met.

What is indentation?

Indentation is used for readability improvements and is up to the programmers taste.

  1. To repeat an action
  2. Repeat a piece of code
  3. Do-loops have to execute at least once
  4. A way to format code