- Looping control flow allows us to go back to some point in the program.
- Loops are created when you use keywords
while
ordo
orfor
follow by an expression and allow to go back in the control flow and execute the program again. - A
do-loops
have at least one execution andwhile-loops
can have zero executions. - The role of this indentation inside blocks is to 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. - Repetition of the specific statement or program code until specific criteria met.
- 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. - 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.
-
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.
-
Loops will repeat sections of code until certain criteria is met before proceeding to execute the rest of the code.
-
With while the loop will keep entering the statement as long as the expression gives a value that equals true. A do loop will always execute its body at least once regardless if the expression equals true or false. It starts testing whether it should stop only after the first execution.
-
Indentation simply refers to adding spaces infront of statements to make the structure of the code stand out so others can easily read it. These spaces are optional and dont affect the code.
Allows you to go back to a specific point in the program and repeat it.
Loops lets the program execute a particular thing multiple times.
while loops only work if the product meets a certain criteria . Do loops do only evaluate the conditions after it has been executed once.
just a way to structure your program
Hi @welowy,
You need to specify the type of file it is before Atom can recognise the code and highlight it accordingly. If youâre writing Javascript, make sure to save the file as âmyNewFile.jsâ. Remember to put the extension â.jsâ. When Atom sees this extension on the file name, it knows its a JS file and gives colour based on syntax automatically.
What does the loop control flow allow us to do?
It allows us to return or return to a point in the program where we create the condition and repeat it, that is, it allows us to execute a code several times avoiding complexity.
Describe what âloopsâ do in your own words.
they take care of repeating a series of lines of code as many times as the programmer indicates or until a certain condition occurs.
Whatâs the difference between while and do-loops?
The WHILE statement first executes the condition before looping and if the condition is met the operations will be repeated indefinitely or until the condition is met if the condition is not met, the statements within the cycle will not be executed.
The difference is that the DO WHILE loop operates the condition after making the statements that are inside the loop while this means that it will be executed at least once.
What is sangria?
The indentation is a blank space that allows the code to be displayed making it more readable, easier to understand, modify and improve, this allows the code to be highlighted.
1: let us create loops using the keyword âwhileâ. The code keep creating results to our input code until the boolean expression become false.
2: They are like someone hitting the = button in a calculator, over and over again. example : 2 + 2 = 4 = 6 = 8 = 10 etcâŚ
Basically with loops we can tell the computer, run this code until this expression is true and stop only when it becomes false. letâs say. Count until 10, starting from 1, every time add +1. The code would go, 1+1 = 2 TRUE 3,4,5,6,7,8,9,10 TRUE 10 + 1 FALSE so the program stops and donât print 11
3: they are similar but do loops run at least once, while runs until conditions are false
4: Adding spaces, or tabs to make the code stand out and easier to read and understand when one statement start and ends.
-
looping and control flow allow us to run a piece of code multiple times more efficiently.
-
loops repeat a set of instructions.
-
while loops are like if statements. Do-loops will always execute at least once.
-
indentation is used to make code more legible. It when new block of code opens up and which blocks are inside of which.
- What is looping control flow allowing us to do?
- It executes a statement over and over, until the desired outcome is generated. This allows dealing with patterns without typing a statement many times.
- Describe what âloopsâ do in your own words.
- Exercise a command;
- Check if the final condition is met;
- If not, exercise again;
- If yes, stop.
- What is the difference between while and do-loops?
- While loops check if the final condition is met already before start.
- Do loops always run at least once.
- What is indentation?
- It is the line breaks and tabs in a code to make it readable for developers. It doesnât change anything for the program. If you like, you may as well write the whole thing in one line. However, then it may be difficult to make changes or find errors.
- In a browser console, as well as text editor programs this happens automatically in the commonly preferred style.
Answers:
-
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. -
Loop allow us to execute a huge number data to derive a specific result of what seems to be a tedious task can be loop coded in a simplify way (shortest coding)
-
A while loops check the condition before execution while a do loops start testing whether it should stop only after its first execution. In another words, it verify the contents only after its first execution.
-
Indentation is arranging the coding by adding spaces in between or line breaks which makes the coding neat and tidy. In truth, the program doesnât care and will do just fine without them.
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 the program to be written in a simpler and more efficient manner for the programmer. It allows you to simplify repetitious functions to make the code writing more efficient.
3. What is the difference between while and do-loops?
A while loop will keep running until a condition is met. A do loop always executes at least the first time, then it will test to see if it should continue.
4. What is indentation?
Is the act of putting spaces on the next line of code before a new block is opened. This is done with the space bar or the tab function. Different coders have different styles, but its important to stay consistent. Indentation is used to make the code easier to read.
- A loop is a coding control structure that allows us to go back to a previous point in the program & run a task until a certain condition is met.
- Loops make a program more efficient using less code to achieve more in the program.
- A DO loop always executes a task at least once & starts testing if it should stop only after this first iteration. A WHILE loop checks if a condition is met before running its task.
- Indentation is layout formatting making blocks of code stand out which is easier for the human eye to read.
1.What is looping control flow allowing us to do?
Looping is a control structure that goes back to a previous pint and run until the specified condition is met.
2.Describe what âloopsâ do in your own words.
Loops runs a program until specified condition is met and stops or jumps/continue in current program state.
3.What is the difference between while and do-loops?
In while the loops keeps entering the statement as long as the expression produces a value is true when converted to boolean.
In do the loop executes its body at least once.
4.What is indentation?
It is to insert space in front of statements which makes the code easy reading .
-
What is looping control flow allowing us to do?
Looping control allows for the ability to go back at some point in the program with the current program state. -
Describe what âloopsâ do in your own words.
Loops are program iterations until a condition is met or conditions are met whereby execution of code is initiated. -
What is the difference between while and do-loops?
A while loop checks its condition at the beginning of the body while the do loop checks the condition after the body of statements. -
What is indentation?
Its a process for structuring code so that it is easier to read. Indenting blocks of code, the visuals of the code are much easier to interpret.
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, makes less work not more.
What is the difference between while and do-loops?
A while loop will only execute the code if the conditions are true.
A do-loops will execute the code without checking the conditions are true, after the first execution if it finds the conditions are false it will not loop again until the conditions become true.
What is indentation?
Each programmer might have their own style of writing code, some might write the whole code in a singular line.
The purpose of indentation is to make the structure of code stand out inside a block, some might use 2 spaces or 4 spaces or use tab characters when generating a new open block. Makes code easier to read, edit etc.
- What is looping control flow allowing us to do?
Run lines of code over and over without needing to write the line of code more than once. - Describe what âloopsâ do in your own words.
Loops run lines of code when a condition is true. - What is the difference between while and do-loops?
While loops check the condition before running any code, and do loops run the code and then begin checking the condition. - What is indentation?
Indentation is a coding etiquette to help visually structure blocks of code to make it easier to look at.
Loops - and reading Assignment:
- It enables the programmer to go back to a point in the program where we were before and repeat.
- In certain cases Loops negates the need for multiple code entries.
- While loops tests if T / F first then run and a Do Loop will run the code once and then check T / F.
- Indenting code makes it easier to see where blocks end and others begin.
-
What is looping control flow allowing us to do?
To go back to a point in the code and repeat it over and over again. -
Describe what âloopsâ do in your own words.
As long as some condition are fulfilled, the program jumps back to a certain point and repeat the code with the new value. -
What is the difference between while and do-loops?
In a while loop, it is decided before the first run, weather or not it should run.
In a do loop it is decided after the first run, weather or not it should repeat. -
What is indentation?
The use of spaces to let the structure of the code stand out.
1.It allows us to go back in a previous point in the code and repeat it with our current program state.
2.A loop repeat a statement in the program several times. This is useful because it saves time.
3.The difference is that the while loop keeps entering the statement until the expression produces a Boolean value. Do-loops are nearly same structured. The only difference is that a do-loop executes its body at least once, and it starts testing if it should stop only after the first execution.
4.Indentions are empty space between statements inside the blocks.
We use indentation to make the structure of code stand out.
Hi! @jon_m,
Thank you for your time and your reply, and sorry for taking my time to respond.
This was my very first program ever, i was reading eloquent JavaScript and taking notes and suddenly i was like: â
I THINK i can solve that project euler thing now!
â
And then i just started to experiment and build my solution. I think i wasted and entire day trying different stuff and coding, erasing, and redoing. Just trying to puzzle together a solution that works. So it is what it is- but i was very satisfied that i was able to get it working finally. Now, had i just relaxed and maybe read a few more pages before i started coding, i think the whole thing would have been much more painless.
Now, for the actual code. I actually added some of that superfluous code that didnât do much (or anything) just so that it would make sense to me, and not the program itself, as well as being able to show it to a couple of friends. I also wasnât sure which keywords i was supposed to use for the bindings in regards to scope, and how all that worked. But all of this is a constant learning experience, iâm glad to move forward in my knowledge about all of this. The if(count < number)
was added as a late addition to the program because the multiples of three and five between 0 and 10 shouldnât contain 10 itself, according to the assignment on Project Euler. But i understand what you mean that i could have changed the count <= number
to count < number
in the for loop instead of adding a second if statement. It would have made for a better solution. I probably just didnât want to mess with my code now that i finally had gotten it working, or something like that And the result variable is obviously unnessecary, thanks for pointing that out.
I appreciate the help and the reply. At the time i wrote that i barely understood anything about coding, so itâs good that there are people like you who has a clearer understanding and are willing to help out. Thanks for taking the time to teach me.