- What is looping control flow allowing us to do?
A way to run a piece of code multiple times. - Describe what “loops” do in your own words.
a Loop allows us to go back to some point in the program operation and rerun the operation at that program state. - What is the difference between while and do-loops?
While loop allows code to be executed repeatedly based on a given Boolean condition and a do loop is similar to while loop with the only difference that it checks for the condition after executing the statements - What is indentation?
Indentation inside blocks make the structure of the code stand out.
- 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.
- runs a block of code until conditions are met.
- A do loop always executes its body at least once and it starts testing whether it should stop only after that first execution. While loop keeps enterint the statement as long as the expression produces a value that gives true when converted to Boolean.
- Indentation is like spacing in your code, just to make it easier to understand for the developer, i f you want you can right code in 1 line, basically it is only for your own benefit.
1. What is looping control flow allowing us to do?
Minimize time and number of lines of code for an outcome
2. Describe what “loops” do in your own words.
They run something again and again until a threshold is met
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?
Not necessary for computers, but easier for humans to make out the structure of the code.
What is looping control flow allowing us to do?
Repeats a program over and over until a certain condition is met.
Describe what “loops” do in your own words.
Loops repeat programs as defined by the type of loop being used (while, do and for)
What is the difference between while and do-loops?
“A do loopisacontrolstructuresimilartoa while loop. Itdiffersonlyonone point: 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?
Indentation is used to make the code easier to interprit by another programer, or the programmer himself, during later review.
-
What is looping control flow allowing us to do?
-Execute the same code repeatedly certain amount of times -
Describe what “loops” do in your own words.
-Loops can execute same code multiple times for example if we want to find all odd numbers between 0 & 100 we can do it with a loop. -
What is the difference between while and do-loops?
-While loop executes only if the condition is true. do-loop always executes once and will continue if the condition is still valid. -
What is indentation?
Easily readable code structure. Its not a rule but recommended to do for others to understand your code better.
- Looping control flow allows the program to jump back to an earlier point to repeat the steps
- Loops allow programs to repeat steps within the parameters that have been set
- WHILE loop checks condition at beginning of loop. If the condition fails, the loop does not execute even once. Whereas DO WHILE loop checks condition at end of the loop so the loop executes at least once, even if the condition fails.
- Indentation allows the structure of the code to be seen more easily
-
Loops allow us to repeat parts of coding. the number of loops can be controlled via variables
-
while: if a condition is fulfilled the the code is repeated until the condition no longer applies
do while: executes the code initial once, then the code is repeated until the condition no longer applies
for: shorter and more universal form of the while loop
-
see 2.
-
Indentions are not technically necessary, but code parts are indented within loops or conditions for better readability.
Hi to all the community. Not sure if this is the right place to ask this question or whether there is a more appropriate place on the forum.
I am early on in my programming life and am struggling with the For loops. I am using Atom text editor but I am unable to get simple For loops to work on a wep page. I am trying to search out solutions on Google but wondered if anyone else was having similar issues. I am sure there is a simple answer and i will keep looking.
Thanks
-
It allows us to run a piece of code multiple times.
-
Loops allow us to go back to a previous written code with a current one that allow’s us to repeat the previous code.
-
The difference is that, while Loops continue to loop in a program as long as the expression of a condition is true.
A DO loop always executes it’s body or statement between brackets at least once before finding out if the condition is true. -
Indentation is spaces in front of statements to make the coding more readable.
-
What is looping control flow allowing us to do?
Looping control flow allows us to go 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.
Until a certain condition is not true anymore, a loop allows us to run a piece of code over and over again. This makes the program lighter without having to write to code extensively. -
What is the difference between while and do-loops?
Although they are similar, a Do Loop runs the code at least once before checking if the boolean is true or false. The While Loop checks it in the beginning. -
What is indentation?
Indentation is a technique used in coding in order to make it look easier to identify/read the code. Spaces in statements that are part of the same block are an example. Code clean!
1. What is looping control flow allowing us to do?
It allows running a piece of code multiple times.
2. Describe what “loops” do in your own words. Loop is a repetitive function that produces a value.
3. What is the difference between while and do-loops? While loop keeps entering that statement as long as the 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 do whether it should stop only after that first execution.
4. What is indentation? The role of this indentation inside blocks is to make the structure of the code stand out. With proper indentation, the visual shape of a program corresponds to the shape of the blocks inside it.
From:Horacio
- Allows the program to go back to the start of a conditional execution .It a way to run a piece of code multiple times.
- Allow us to go back on our previous step. , on our current program state .
- A loop always executes its body at least once.The keyword while creates a loop & is followed by an expression in parentheses and then statement.
- Is adding spaces in front of statement that are part of some larger statement.
- Looping control flow allows us to go back to some part of the program where we previously were, and repeat it in our current program state.
- Loops repeat a piece of program until certain preset criteria are met (except for infinite loops which continue forever).
- While loops check the program state first and then runs the loop if certain criteria are met. Do loops run the loop first, and then check the program state afterwards to determine whether to break out of the loop, or repeat it.
- Indentation is a way of formatting code to make it easier to read. Lower hierarchy code is moved to the right.
1
allows to repeat a task and search for solution within a set zone
(for example search in-between the numbers from 1 to 100) without having to program each single step separately in-between.
2
repeats an action until a certain criteria is met. automates the action, i don’t need to write the code for every single step
3
do = runs until it gets the valid input
while= runs until it reaches a specific value
–> I like Julians easy explanation:
If while was a person it would say, “Hey Mr. Programmer loop this”. A do-loop would say, “Hey. Mr.Programmer, loop this but make sure to DO this also”.
4
spaces between the left and right margin, namely at the beginning of the line. the purpose is more about readability.
- 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. - I’ts a characteristic kind of program that executes the same control flow until a given halt. It looks like it runs itself.
- A while loop runs untill a given ‘halt’, a do loop runs itself at least one time or but keeps on running untill a satisfied input is given.
- It makes reading program easier to follow.
1.Looping control flow allows a piece of code to run multiple times
2.Loops are a way in which a set of instructions and or values from the script is repeated until a certain condition is met
3.The do-loop starts to test if it is required to stop after the first execution
the while-loop will force an operation to continue
4.Indentation is a visual way to write JavaScript so the spaces in front of the statements can be easily read. The spaces are not required but makes writing and editing code more easy
- Looping control flow allows the program to go back to some point in the code where
we were before and repeat it with a current program state. - Do boring repeating things instead of writing repeating statements.
- First execution is conditional using if while a do statements runs at least once.
- The role of indentation inside blocks is to make the structure of the
code stand out.
-
Looping control flow allows specific blocks of code to be repeated as many times as necessary. It enables the program to return to a previous point, while, at the same time, maintaining its current state (i.e. it starts the next iteration with the values assigned to its variables in the preceding iteration). This means we don’t have to waste our time writing out the same sequence of statements many times over.
-
The start of a loop is announced by the keyword
while
,do
, orfor
.
Loops contain a Boolean expression which checks whether the value assigned to an iterator variable — which acts like a counter — meets a specific condition. If this condition is met, the expression evaluates totrue
and the loop’s code block is executed. If the Boolean expression evaluates tofalse
then the loop is exited. Each time the loop’s code block is executed, the counter is updated (increased or decreased by a certain amount) and then rechecked by the Boolean expression. If it still meets the condition, the same code block is repeated. This continues until the Boolean expression evaluates tofalse
.
As well as the iterator variable counting the number of times the loop’s code block has been repeated, loops can also use another variable to keep a cumulative record of the iterative computation being performed. This second variable is updated with the result of each repetition of the loop. The updated value is then fed back into the computation during the next iteration. This continues until the loop is exited, at which point the final result can be accessed by the program via the variable’s name. -
While loops start by evaluating the Boolean (conditional) expression before executing their code block for the first time. This means that, if the condition is not met from the outset, the loop’s code block will be omitted completely.
In contrast, the conditional expression in do loops is placed after the code block. This means that the code block will always be executed at least once before the loop is exited. -
Indentation is where a nested statement not only starts on a new line, but is also preceded by more whitespace than its parent. This is not a requirement for the program to be executed correctly, but helps the developer organise the code, and gives the program a clear structure. This makes the code easier for the author and other developers to read, follow, edit and debug. For this reason, it is considered good practice to indent each nested statement according to how deeply it is nested within other statements and code blocks.
Allows us to code multiple times.
Looping control allows to execute a program that has a static state to process a routine or solve a problem.
A do loop is a control element that you must do before proceeding while a while loop executes until it has processed its instructions.
indentation provides a visible shape of program that corresponds to the blocks inside it.
-
What is looping control flow allowing us to do?
It allows us to return to a previous statement in the program and execute it again whilst the environment is in a different state. When we combine this with a binding where the value can be incrementally changed this becomes very powerful. -
Describe what “loops” do in your own words.
A loop is a piece of program that interrupts normal flow control. You enter the loop on a conditional statement. If the condition evaluates to true the code within the loop is executed and we return to the loop’s conditional statement where it is tested again. The looping continues until the conditional statement evaluates to false upon which normal flow control is resumed. -
What is the difference between while and do-loops?
While loops test the condition at the start of the loop and so may never run. Do-loops however, test the condition at the end of the loop and so is guaranteed to run at least once. -
What is indentation?
Indentation makes no difference to the computer, but creates a structure in the program that makes it easier for the programmer to read and understand. It helps to make conditional blocks of code and loops stand out.