Loops - Reading Assignment

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 repeat it with our current program state.
2. Describe what “loops” do in your own words.
It allows us to run a piece of code over and over again until the boolean condition is no longer true, or until a break statement is executed.
3. What is the difference between while and do-loops?
The do-loops executes the body at least once, but the while only executes if the boolean condition is true.
4. What is indentation?
Indentation is the space in front of statements, that makes it more readable and obvious to which block a statement belongs.

  • What is looping control flow allowing us to do?
    It orders the order that statements are executed.
  • Describe what “loops” do in your own words.
    They continue the function that is input to them, for example, using 1-100 or something like that.
  • What is the difference between while and do-loops?
    a while loop checks to see if a statement is true or false, a do loop has to run multiple times.
  • What is indentation?
    a way of structuring your code so it’s easy to tell where it’s going and how it’s being put together.
  1. Looping control flow allows the programm too go back to a conditional execution and rerun it with it’s current state
  2. Loops allows the programmer to optimze code that repeats itself, and write it in a more compact way
  3. The conditional statement is written in the beginning for a while loop and at the end for a do loop. This has the effect that the do loop executes it’s boody at least 1 time.
  4. A visual way to structure the code and make it easier to read
  1. What is looping control flow allowing us to do? It allows us to run a piece of code multiple times.

  2. Describe what “loops” do in your own words. Loops run a piece of code one or more times either until some specified number is reached or until some condition in true or false or even infinitely.

  3. What is the difference between while and do-loops? In a while loop the word “while” is followed by an expression in parenthesis and then a statement. The loop keeps entering the statement as long as the expression produces a value that gives true when converted to Boolean. A do-loop differs from a while loop on only 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? Is is displacement of the edge of a block of text in relation to the margin or other blocks of text to make the structure of the code stand out.

I looked up “loop” in the dictionary and it said “see: loop”. :sunglasses:

  1. execute program over and over
  2. They keep running program until a specific result is reached
  3. A do loop will always execute body first then check status
  4. Keeps program code neat and easy to see where different pieces are

1. It allows to go back to some point in the program where it was before and repeat it with the current program state.

2. Loops are used to repeat a task until certain conditions are fulfilled.

3. A while loop first checks if the condition is true or false and then runs the code for the first iteration. A do…while loop will run the code at least for one iteration, and then check if the condition is true or false.

4. In most programming languages indentation is just used to make the code more readable and clear and therefore make it easier to read, understand, modify and maintain. However, in Python for example indentation is part of the syntax which means that the compiler will interpret the code differently if important indentations are changed.

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

  2. Describe what “loops” do in your own words.
    A loop will repeatedly run a piece of code until a certain condition is met.

  3. What is the difference between while and do-loops?
    While-loops will only be entered into if a certain condition is met and repeat the code within its block until that condition becomes false.
    Do-loops will always execute the code within its block at least once, because the condition is evaluated after the block of code is run. It will continue to execute the block of code until the condition evaluates to false.

  4. What is indentation?
    Indentation is used to make a programmers code more readable. It is not necessary for the computer itself, as all white space is eliminated at compile time.

What is looping control flow allowing us to do? Condition code to allow you to execute the code inside while the main condition is “true”
Describe what “loops” do in your own words. Repeat a execution until the condition in the loop is true
What is the difference between while and do-loops? Sintaxys
What is indentation? Is the best practice in the art of code
Easier to read
Easier to understand
Easier to modify
Easier to maintain
Easier to enhance

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- Loops have two parts. one part is a boolean expression and other is the statement. As long as the expression value would be true, the statement gets executed.

3- A do loop always executes its body at least one time but while loop might not be executed once if the condition wasn’t true.

4- Adding spaces in front of statements that are part of some larger statement. The role of it inside the 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. Repeats a piece of code multiple times.
  3. 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.

Haha, just crashed my chrome (infinite loop)

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.
run a piece of code multiple times
What is the difference between while and do-loops?
The condition in while is tested at the beginning whereas in do is tested at the end. So do-loop will run at least once
What is indentation?
Makes code easily readable

1 Like

What is looping control flow allowing us to do?
The looping control flow allow us to go back to some point in the program at an earlier point and repeat it over and over until a determined end state.

Describe what “loops” do in your own words.
Loops enable us to automate repetitive tasks.

What is the difference between while and do-loops?
A while loop is a looping mechanism that runs when the boolean statement is true and stops when the condition is false. On the contrary, a do loop has to have the first run to be true and then proceed to following conditions afterwards.

What is indentation?
Indentation is matter of coding syntax for the purpose of visually appealing code for the programmer.

  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.Loops run some pieces of codes several times until requirements are fullfiled
    3.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
  2. the way in programming that we can keep our code clear we can put some spaces or brake the line in code or keep this code in a single line.
1. What is looping control flow allowing us to do? It allows you to go back to a certain 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. It’s a function which let you repeat an action several times till your giving value is met. After that the loop stop.
3. What is the difference between while and do-loops? A do-loop always execute the body at least once, and it starts testing whether  it should stop after that first execution.

What is indentation? Its adding space in the code to make the structure of the code stands out.

  1. Allows you to repeat a task without having to program it all over
  2. copy and past programming
  3. While loops just execute code, do loops execute code and do something else with it
  4. breaks in the code “break;”

1. What is looping control flow allowing us to do?
This allows us to go back and execute a previous line of code instead of continuing.

2. Describe what “loops” do in your own words.
With the help of loops we are able to issue the same instructions without having to re-type the same code.

3. What is the difference between while and do-loops?
They both repeat code except that the do-while loops always execute the main body then it checks the Boolean value.

4. What is indentation?
This refers to the spacing used to differentiate parts of the program. For example, someone looking at a program can easily distinguish functions from blocks without have to read every word if the programmer gave each its own indentation.

“break;” stops your code from going into an infinite loop.

Indentation however, is just how you space your code and make it easier to read. It’s a personal choice how you do it.

Thank you. This is very comprehensive.

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 a portion of code until the evaluation of a conditional exits the loop and continues on to the rest of 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.

4. What is indentation?
Indentation are are spaces which make the code easier to understand. The level of indentation corresponds to the degree of nested blocks. Most code editors automatically indent new lines the proper amount.

  1. Loops allow us to repeat or run a piece of code multiple times.
    2 & 3. The for loop tends to be most popular and allows you to specify the number of times the loop is executed. A while loop allows you to execute code while a condition is met and a do loop or do while loop is like a while loop only it is always executed at least once.
  2. Indentation allows the clean display of code in a program to make it more readable to the user and easier to follow.