Loops - Reading Assignment

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.
Describe what “loops” do in your own words.
Allow a program to perform a repetitive action to simplify calculations until a condition is met.
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
What is indentation?
is the spacing between the margin and the code. The role of this indentation inside blocks is to make the structure of the code stand out and therefore easier to read.

What is looping control flow allowing us to do?
Ans: Loops allow us to go back to some point in the program and then REPEAT some steps with our current program state.
Describe what “loops” do in your own words.
Ans: Loops are a mechanism for any sort of repetition. For example if we want to display numbers from 1 to 100 then loops give us a short cut mechanism to achieve this goal without typing the display related commands 100 times over.
What is the difference between while and do-loops?
Ans:
While loops is executed WHILE a certain condition is met. So if the condition is not met then while loop won’t execute. e.g.

y=0;
while(y<5){
document.write("Y is: ",y)
y=y+1;
}

Above code will execute as long as while condition is met. If we change the value of variable from 0 to 5 then the code won’t execute as the condition is not true. Do-While is used where we want the code to execute at-least ONCE. e.g.

let yourName;
do {
yourName=prompt(“Who are you?”);
} while(!yourName);
document.write("You name is ",yourName)

This code will execute as long as you don’t enter a valid string (anything other than blank).

What is indentation?
Ans:
Indentation is used to make code more readable and presentable. It’s non-technical yet crucial thing as future code readers should be able to clearly read and understand the existing code before putting it to use or before modifying it.

1 Allows us to exercise a piece of code multiple times

2 They repeat code of a defined enviroment untill a condition is met. They do the repetitive jobs

3 ‘while’ will execute if the value is true and then stop
‘do’ will execute at least once without checking.

4 Visually neatly written code

What is looping control flow allowing us to do?
allowing us to repeat a part of a code we where before,with current programe state.It’s make it easy do not wraite and repeat a code many tamies.

Describe what “loops” do in your own words.
facilitates the writing of the code, creating a circle that repeats at least once

What is the difference between while and do-loops?
“loоp” will execute the body at least once, repeating at least once. By adding “while” the body will start until the desired result is reached.

What is indentation?
Improves the look of the code with adding spaces.The different blocks differ from one another. Makes it look easier to understand. Just like the paragraphs in the books.

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.

Describe what “loops” do in your own words.
It’s a way to run a piece of code multipletimes.

What is the difference between while and do-loops?
A while loop keeps entering a statement as long as an expression produces a value that gives true when converted to Boolean.
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?
The role of indentation inside blocks is to make the structure of the code stand out.

What is looping control flow allowing us to do?

  • come back to certain point and repeat the code again
    Describe what “loops” do in your own words.
  • repeat the desire procedure again and again until the condition is violated.
    What is the difference between while and do-loops?
  • do-loops at least to start the body once.
    What is indentation?
  • it is not a necessary action. but making indentation will make the codes easy to read and manage
  1. Looping control flow is allowing us to go back to a point in the program where we created the condition and repeat it.

  2. Loops repeat statements until a certain specified condition is achieved.

  3. While loops execute if the boolean is true and do loops execute atleast once.

  4.      This is indentation.

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

It is allowing to go back to a previous point in the program’s code and repeat a piece of code a number of times.

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

Loops execute a part of the program a number of times, while the conditions set by the programmer remain true. A certain parameter that is being modified with each loop iteration controls those conditions. Once the conditions are no longer true, the program exits the loop and continues its regular control flow. Basically, loops are a conditional “rinse and repeat” operation.

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

Do-loops always execute once, before they check the conditions set after the keyword while. The while-loops do the conditions testing first, so it’s possible that they won’t execute at all, if the initial conditions are anything but true.

4. What is indentation?

It’s using spaces or tabulation to make program blocks “stand out” in the text editor. It makes it easier for a human programmer to identify different structural blocks of the program, including nested loops and other conditional blocks of instructions such as if and else, for example.

What is looping control flow allowing us to do?
Loop control flow tells the programme to go back to a previous section of the code whilst using newly set variables or other programme state.

Describe what “loops” do in your own words.
A loop repeats a section of code until it finds the condition required (or forever).

What is the difference between while and do-loops?
Google explains this quite well:
While loops will test the condition before the code within the block is executed. The do-while loop is an exit-condition loop. This means that the code must always be executed first and then the expression or test condition is evaluated. If it is true, the code executes the body of the loop again.

What is indentation?
Indenting code just makes it easier to see which line/code is within another code. In excel a code inside another in called a “nested” code, so in JS, to see which code is nested within which other code, indentations are used.

Makes the code easier to look and then understand whats linked to what.

  1. What is looping control flow allowing us to do?
    Allow us to run a code repeating it multiple times until a condition is met.
  2. Describe what “loops” do in your own words.
    Repeat a cycle of coded instructions.
  3. What is the difference between while and do-loops?
    While: execute until condition is reached.

Example:
var number = 1;
while (number != 10){
number+=1;
}

Do while: execute instruction, compare with condition, if not filled, start again the Do loop (until condition is reached).

Example:
var number = 1;
do{
number+=1;
}while(number != 10);

  1. What is indentation?

< html>< head>< title>Ivan Academy Programming Basics< /title>< /head>< body>< h1>this code is not indented< /h1>< /body>< /html>

< html>
< head>
< title>Ivan Academy Programming Basics< /title>
< /head>
< body>
< h1>This code is indented (such beauty, much readable)< /h1>
< /body>
< /html>

Its a way to structure the code in a way that is more easy to read and understand its behavior. (most text editors are able to do this for us).

1 Like

What is looping control flow allowing us to do?
Return to a previous line of code and repeat its expression.
Describe what “loops” do in your own words.
Use an expression(s) over and over until you have an agreed upon value.
What is the difference between while and do-loops?
while statements must first test the variable before the expression in the body is executed while, the DO loop automatically test whats in the body.
What is indentation?
The use of spaces and new lines to create order within the program by allowing you to clearly see the different blocks.

  1. To go back and repeat the code.
  2. Implements code multiple times, streamlining or automating set instructions for the developer.
  3. A do-loop executes at least once regardless, but the difference is that a while-loop will continue only if the value is true when evaluated.
  4. Indentation is used for making strings of code stand out.
  1. What is looping control flow allowing us to do?
    Looping control flow allows the program to repeat a portion of code numerous times until the objective is met.

  2. Describe what “loops” do in your own words.
    Loops carry out fragments of code multiple times until an outcome is met. There are ‘do’, and ‘do while’ loops.

  3. What is the difference between while and do-loops?
    A while loop will execute until the outcome is false whereas a Do while loop can have a true or false outcome.

  4. What is indentation?
    Used to break up the code visually for the coder. They dont get included when the code is run but help the reader to view line by line.

Although not incorrect I think if Expression was changed to Condition and Statements was changed to Body then it’d be more accurate.

1 Like
  1. What is looping control flow allowing us to do?
    To be more succinct in our writing, code for repetition, saves time and makes many things possible
  2. Describe what “loops” do in your own words.
    A loop is a function that you give a set of parameters and a Boolean, The bindings within the parameters eventually makes the Boolean you set to become falsified or break is used
  3. What is the difference between while and do-loops?
    Do loops always run at least once because it tests its Boolean condition after being ran not before (While-loops)
  4. What is indentation?
    It’s a visual convention used to make it easier for humans to read code
  1. It allows us to repeat code until certain conditions are met which eliminates a lot of repetitive coding.
  2. A loop execute a piece of code based on whether the value of a specific expression is true or false. As long as the expression is true the code is repeated. When the expression is false the loop end and execution of the rest of the program resumes.
  3. While loops test the expression at the beginning of the loop which means that if the expression is false to begin with the loop never execute. The do-loop always executes the code in the loop at least once since the test is at the end of the loop.
  4. Indentation is simply a wait to make code more readable for us.

1 What is looping control flow allowing us to do ?

Looping control flow is a way to run a piece of code multiple times. 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 to run the same code over and over again, each time with a different value. Basically, Loops can execute a block of code a number of times.

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

A do loop is a control structure similar to a while loop. 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 ?

Indentations serve no other purpose than making the code readable to you and others. The role of indentation inside blocks is to make the structure of the code stand out. In code where new blocks are opened inside other blocks, it can become hard to see where one block ends and another begins. With proper indentation, the visual shape of a program corresponds to the shape of the blocks inside it.

1. What is looping control flow allowing us to do? It is allowing 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 are an easy and suitable way to repeat multiple times a piece of code.
3. What is the difference between while and do-loops? The difference is that while loops start testing before the first execution and do loops start testing after the first execution.
4. What is indentation? It is a very convenient practice to make the code more structured and readable through adding spaces and line breaks to easily shape and visualize its different blocks.

1)Looping control flow allows us to repeat a set of instructions until the criteria is met

2)Loops perform tedious tasks that can take to much time to type line by line - example counting to 100 by adding +2

  1. while loops will execute the code until a result or condition is met ; do-loops will execute the loop once regardless of conditions

  2. Indentations are used to make the code pretty to read - Java Script does not care about how you write the code - it can be all in one line - but for humans to read it is best to fallowing some indentations practives

  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 re-run a set of instructions within a program as long as they hold true until a certain set of parameters is filled or reached.
  3. What is the difference between while and do-loops? A statement starting with the keyword while creates a loop. The word while is followed by an expression in parentheses and then a statement, much like if. The loop keeps entering that statement as long as the expression produces a value that gives true when converted to Boolean. 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 to help make the structure of the code stands out and makes it look more readable and visually pleasing.