Queston Option Answer 1When using a Whle Do statement, the following rules are e
ID: 3721209 • Letter: Q
Question
Queston Option Answer 1When using a Whle Do statement, the following rules are essenbal RULE 1 But Not RULE 2 RULE 1 or RULE 2 RULE 1 and RULE2 RULE 1 The loop control vanables must be inaised before the WHILE loop is encountered RULE 2 Ins de the loop body, the value o loop control vanable must be modified to ensure that the loop condition becomes FALSE' avod an infinte loop) The output always has a heading TRACE TABLE 2 The trace table is presented n the LustBox Which statement s TRUE? A listbox can only be used for trace table values A lstbox can only display string valucs Only a list box can be used Norie of the options above 3 A nested loop is Any loop wthin another loop (which may be n another loop) An infinte loop. A dauble for loop A double whle loop There is no such thing 4 Grve two reasons why repetition structures are used in pragramming? 2Explanation / Answer
1.--3, both rule 1 and rule 2
Loop control variables must be initialized before WHILE loop is encountered because in the while loop we write condition or expression to check whether it is true or false.Here we are checking the expression only, hence the variables must be declared and initialized before.
Loop control variable must be modified else it becomes an infinite loop.
if we don't modify the variable the condition will be always true (met) and the section of code is repeated continuously.so to avoid that control variable must be modified such that at some time the condition becomes false and code in the loop will not be executed.
2 --- 5, none of the above.
whatever name we gave for the list box that will be displayed, we can use listbox for other purposes also, not only trace table.Listbox displays other data types also.
3. -- 1.Any loop within another loop.
A double for and double while loops are also nested loops.But nested loop not only means double for or while but any loop present in another loop.
4.repetition structures are nothing but loops.
if we want a block of code or set of instructions to be executed multiple times then we use repetition structures instead of writing code those many times.So we use loops to reduce redundancy.
if we want to execute the code until a condition is met, then also we use loops.When the condition is not met the code is not executed.So we use loops for conditional execution.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.