answersLogoWhite

0

Well, from my knowledge of pseudocode, a pre-test loop contains the DO WHILE and LOOP functions.

So say you want to pour some milk into your cereal for breakfast:

DO WHILE cereal_bowl.Full = False

Pour_Milk

LOOP

Basically this is you saying, I am going to pour milk WHILE the bowl is not full. Once the bowl is full you will stop because you checked before your poured (a pre-test).

Hope this helps.

- The Doctor

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
RossRoss
Every question is just a happy little opportunity.
Chat with Ross
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
More answers

While construct

User Avatar

Wiki User

12y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What is an example of a pretest loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is counted pretest loop?

While loop is counted as pretested loop.


What the difference between pretest loop and posttest loops?

The difference is that pre means before and post means after in Latin so it's tested before or after. :)


Is the for loop a pretest type of loop?

Pretest loops, such as for-loop, while-loop, execute/evaluate the condition statement first, if the condition is met, then the statements of the loop are executed. If you were referring to the body of the loop being carried out at least once, no, the body will not be touched if the condition fails (pre-test, test BEFORE the [next] execution of the body). But the condition of the loop must have been evaluated at least once.In contrast to the post-test loops, such as do-while, repeat-until, the condition is evaluated AFTER the [next] execution of the body. It is possible that the condition is never evaluate, and not the entire loop body being executed.


How is a while loop different from a do until loop in gml?

In any programming language, a "while" loop and a "do until" loop are the same except for 1 difference. In order to enter a while loop, the condition must always be true. But in a do until loop, if the condition was false, the block of code inside the loop will always be ran at least once. Example: while (false) { // code here } in this example, the code inside the while loop will never run, but in the following example: do { //code here } until(false) although the condition is false, the code will be run 1 single time and the exists the loop.


What are the components of loop?

a loop consist of data initialization;test condition;updation; example a for loop for(int a=1;a<5;a++) the loop will be executed 5 times four positives result and the last test condition will be failed and the loop will be exited there are many loops some of them are while loop,do...while loop,for loop,maybe more...... do while is an exit check loop and while and for are entry check loop.