Deck 4: Looping

ملء الشاشة (f)
exit full mode
سؤال
When you do not know when you write the program whether the loop will be executed two times,200 times,or not at all you should use a definite loop.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Commonly,you control a loop's repetitions by using either a counter or a ____ value.

A) flag
B) keystone
C) control
D) sentinel
سؤال
All programming languages assign 0 to a variable you fail to initialize explicitly.
سؤال
The decision that controls every loop is always based on a ____ expression.

A) Boolean
B) numeric
C) conditional
D) contrived
سؤال
Just as with a selection,the Boolean comparison that controls a while loop must compare same-type values.
سؤال
If a data item is valid,you can assume that it is also correct.
سؤال
When a loop control variable is numeric,its value is often altered by ____ it,or adding to it.

A) decrementing
B) indicating
C) incrementing
D) increasing
سؤال
The number of times a loop executes should always depend on a constant.
سؤال
It is always a mistake to fail to initialize a loop's control variable.
سؤال
A ____ is the structure that repeats actions while some condition continues.

A) decision
B) loop
C) branch
D) block
سؤال
You can use any of the ____ comparison operators to control a loop.

A) three
B) four
C) five
D) six
سؤال
Most languages provide a built-in way to check whether a value that is entered is numeric or not.
سؤال
An accumulator is the same thing as a counter that you use to count loop iterations.
سؤال
While making decisions is what makes computers seem intelligent,it's looping that makes computer programming both efficient and worthwhile.
سؤال
A loop for which the number of iterations is predetermined is called a(n)____ loop,or counted loop.

A) infinite
B) definite
C) optimal
D) defined
سؤال
Once your logic enters the body of a structured loop,you can exit the loop body early if you program it correctly.
سؤال
When you write a loop,you must control the number of repetitions it performs; if you do not,you run the risk of creating a(n)____ loop.

A) final
B) infinite
C) unbreakable
D) permanent
سؤال
As long as a Boolean expression remains true,a ____ loop's body executes.

A) do
B) go
C) while
D) begin
سؤال
Some loops are controlled by reducing,or ____.

A) decrementing
B) incrementing
C) indicating
D) compensating
سؤال
When you use a ____ within a computer program,you can write one set of instructions that operates on multiple,separate sets of data.

A) counter
B) variable
C) loop
D) sentinel
سؤال
Many programs are not run at the command prompt in a text environment,but are run using a ____,which allows users to interact with a program in a graphical environment.

A) UML
B) GOOY
C) GUM
D) GUI
سؤال
Program logic gets more complicated when you must use loops within loops,creating ____ loops.

A) interwoven
B) stacked
C) nested
D) connected
سؤال
When one loop is nested within another,the loop that is contained is the ____ loop.

A) outer
B) inner
C) controlling
D) bounding
سؤال
Loops are frequently used to ____ data; that is,to make sure values fall within an acceptable or reasonable range.

A) validate
B) enter
C) add
D) manipulate
سؤال
When one loop is nested within another,the containing loop is the ____ loop.

A) inner
B) controlling
C) bounding
D) outer
سؤال
The ____ statement uses a loop control variable and provides you with three actions automatically in one compact statement: initialization,evaluation and incrementation.

A) do
B) while
C) for
D) count
سؤال
A(n)____ value is a number you use to increase a loop control variable on each pass through a loop.

A) jump
B) bump
C) increment
D) step
سؤال
Programmers use the term "____" to describe programs that are well designed and easy to understand and maintain.

A) simple
B) complex
C) elegant
D) classic
سؤال
Many programmers prefer starting their counted loops with a variable containing a(n)____ value.

A) 0
B) 1
C) arbitrary
D) constant
سؤال
A value such as "Y" or "N" that a user must supply to stop a loop is called a(n)____ value.

A) flag
B) sentinel
C) indicator
D) overlook
سؤال
To indicate end-of-file,use the ____ indicator.

A) endfile
B) End-of-File
C) Control-z
D) eof
سؤال
Often,the value of a loop control variable is not altered by arithmetic,but instead is altered by ____.

A) infinite loops
B) machine input
C) user input
D) the loop
سؤال
Business reports that list no individual detail records,just totals,are called ____ reports.

A) overall
B) summary
C) executive
D) roll-up
سؤال
A(n)____ is any numeric variable you use to count the number of times an event has occurred.

A) accumulator
B) holder
C) scratchpad
D) counter
سؤال
A(n)____ is a variable that you use to gather or accumulate values.

A) indicator
B) holder
C) accumulator
D) aggregator
سؤال
The ____ is the location on your computer screen at which you type entries to communicate with the computer's operating system using text.

A) command prompt
B) command shell
C) input prompt
D) run prompt
سؤال
Which of the following is NOT a mistake that programmers commonly make with loops?

A) Neglecting to initialize the loop control variable
B) Using the wrong comparison with the loop control variable
C) Neglecting to alter the loop control variable
D) Including statements outside the loop that belong inside the loop
سؤال
With a ____ loop,the loop body executes once before the loop-controlling condition is tested.

A) do-while
B) while
C) do
D) for
سؤال
Reports that include some output for every input record are ____ reports.

A) summary
B) detail
C) executive
D) running total
سؤال
Every high-level computer programming language contains a ____ statement that you can use to code any loop,including both indefinite and definite loops.

A) do
B) while
C) for
D) count
سؤال
The following pseudocode is not working properly.The message should display five times.This is not working because the programmer made which common loop mistake? Declarations
Num count
String message = "OK"
While count < 5
Output message
Count = count + 1
Endwhile

A) Neglecting to initialize the loop control variable
B) Neglecting to alter the loop control variable
C) Using the wrong comparison with the loop control variable
D) Including statements inside the loop that belong outside the loop
سؤال
Using a while loop,write the pseudocode to display "I love programming!" five times.
سؤال
The following pseudocode is not working properly.The message should display five times.What needs to be changed? Declarations
String message = "OK"
While count < 5
Output message
Count = count + 1
Endwhile

A) while count < 5 should be changed to while count = 5
B) num count = 1 should be added to the Declarations
C) num count should be added to the Declarations
D) num count = 0 should be added to the Declarations
سؤال
In the following pseudocode,what will be the value of sum after the code is run? Declarations
Num count = 0
Num sum = 0
While count < 3
For X = 1 to 2 step 1
Sum = sum + X
Endfor
Count = count + 1
Endwhile

A) 3
B) 6
C) 9
D) 12
سؤال
The following pseudocode is not working properly.The message should display 10 times.What needs to be changed? for count = 0 to 10
Output "I love programming!"
Endfor

A) The for statement should be:
For count = 0 to 9
B) The for statement should be:
For count = 0 to 9 step 1
C) The for statement should be:
For count = 0 to 10 step 1
D) The for statement should be:
For count = 0 to 8 step 1
سؤال
Name the three crucial steps that must occur in every loop.
سؤال
The following pseudocode is not working properly.The message should display 10 times.This is not working because the programmer made which common loop mistake? for count = 1 to 10
Output "Hello"
Endfor

A) Neglecting to initialize the loop control variable
B) Neglecting to alter the loop control variable
C) Using the wrong comparison with the loop control variable
D) Including statements inside the loop that belong outside the loop
سؤال
Using a for loop,write the pseudocode to display "I love programming!" five times.
سؤال
Write the logic for a program that outputs every even number from 2 through 16.
سؤال
Name three common mistakes that programmers make when programming with loops.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 4: Looping
1
When you do not know when you write the program whether the loop will be executed two times,200 times,or not at all you should use a definite loop.
False
2
Commonly,you control a loop's repetitions by using either a counter or a ____ value.

A) flag
B) keystone
C) control
D) sentinel
D
3
All programming languages assign 0 to a variable you fail to initialize explicitly.
False
4
The decision that controls every loop is always based on a ____ expression.

A) Boolean
B) numeric
C) conditional
D) contrived
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
Just as with a selection,the Boolean comparison that controls a while loop must compare same-type values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
If a data item is valid,you can assume that it is also correct.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
When a loop control variable is numeric,its value is often altered by ____ it,or adding to it.

A) decrementing
B) indicating
C) incrementing
D) increasing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
The number of times a loop executes should always depend on a constant.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
It is always a mistake to fail to initialize a loop's control variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
A ____ is the structure that repeats actions while some condition continues.

A) decision
B) loop
C) branch
D) block
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
You can use any of the ____ comparison operators to control a loop.

A) three
B) four
C) five
D) six
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
Most languages provide a built-in way to check whether a value that is entered is numeric or not.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
An accumulator is the same thing as a counter that you use to count loop iterations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
While making decisions is what makes computers seem intelligent,it's looping that makes computer programming both efficient and worthwhile.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
A loop for which the number of iterations is predetermined is called a(n)____ loop,or counted loop.

A) infinite
B) definite
C) optimal
D) defined
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
Once your logic enters the body of a structured loop,you can exit the loop body early if you program it correctly.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
When you write a loop,you must control the number of repetitions it performs; if you do not,you run the risk of creating a(n)____ loop.

A) final
B) infinite
C) unbreakable
D) permanent
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
As long as a Boolean expression remains true,a ____ loop's body executes.

A) do
B) go
C) while
D) begin
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
Some loops are controlled by reducing,or ____.

A) decrementing
B) incrementing
C) indicating
D) compensating
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
When you use a ____ within a computer program,you can write one set of instructions that operates on multiple,separate sets of data.

A) counter
B) variable
C) loop
D) sentinel
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
Many programs are not run at the command prompt in a text environment,but are run using a ____,which allows users to interact with a program in a graphical environment.

A) UML
B) GOOY
C) GUM
D) GUI
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
Program logic gets more complicated when you must use loops within loops,creating ____ loops.

A) interwoven
B) stacked
C) nested
D) connected
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
When one loop is nested within another,the loop that is contained is the ____ loop.

A) outer
B) inner
C) controlling
D) bounding
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
Loops are frequently used to ____ data; that is,to make sure values fall within an acceptable or reasonable range.

A) validate
B) enter
C) add
D) manipulate
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
When one loop is nested within another,the containing loop is the ____ loop.

A) inner
B) controlling
C) bounding
D) outer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
The ____ statement uses a loop control variable and provides you with three actions automatically in one compact statement: initialization,evaluation and incrementation.

A) do
B) while
C) for
D) count
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
A(n)____ value is a number you use to increase a loop control variable on each pass through a loop.

A) jump
B) bump
C) increment
D) step
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
Programmers use the term "____" to describe programs that are well designed and easy to understand and maintain.

A) simple
B) complex
C) elegant
D) classic
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
Many programmers prefer starting their counted loops with a variable containing a(n)____ value.

A) 0
B) 1
C) arbitrary
D) constant
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
A value such as "Y" or "N" that a user must supply to stop a loop is called a(n)____ value.

A) flag
B) sentinel
C) indicator
D) overlook
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
To indicate end-of-file,use the ____ indicator.

A) endfile
B) End-of-File
C) Control-z
D) eof
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
Often,the value of a loop control variable is not altered by arithmetic,but instead is altered by ____.

A) infinite loops
B) machine input
C) user input
D) the loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
Business reports that list no individual detail records,just totals,are called ____ reports.

A) overall
B) summary
C) executive
D) roll-up
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
A(n)____ is any numeric variable you use to count the number of times an event has occurred.

A) accumulator
B) holder
C) scratchpad
D) counter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
A(n)____ is a variable that you use to gather or accumulate values.

A) indicator
B) holder
C) accumulator
D) aggregator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
The ____ is the location on your computer screen at which you type entries to communicate with the computer's operating system using text.

A) command prompt
B) command shell
C) input prompt
D) run prompt
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
Which of the following is NOT a mistake that programmers commonly make with loops?

A) Neglecting to initialize the loop control variable
B) Using the wrong comparison with the loop control variable
C) Neglecting to alter the loop control variable
D) Including statements outside the loop that belong inside the loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
With a ____ loop,the loop body executes once before the loop-controlling condition is tested.

A) do-while
B) while
C) do
D) for
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
Reports that include some output for every input record are ____ reports.

A) summary
B) detail
C) executive
D) running total
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
Every high-level computer programming language contains a ____ statement that you can use to code any loop,including both indefinite and definite loops.

A) do
B) while
C) for
D) count
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
The following pseudocode is not working properly.The message should display five times.This is not working because the programmer made which common loop mistake? Declarations
Num count
String message = "OK"
While count < 5
Output message
Count = count + 1
Endwhile

A) Neglecting to initialize the loop control variable
B) Neglecting to alter the loop control variable
C) Using the wrong comparison with the loop control variable
D) Including statements inside the loop that belong outside the loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
Using a while loop,write the pseudocode to display "I love programming!" five times.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
The following pseudocode is not working properly.The message should display five times.What needs to be changed? Declarations
String message = "OK"
While count < 5
Output message
Count = count + 1
Endwhile

A) while count < 5 should be changed to while count = 5
B) num count = 1 should be added to the Declarations
C) num count should be added to the Declarations
D) num count = 0 should be added to the Declarations
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
In the following pseudocode,what will be the value of sum after the code is run? Declarations
Num count = 0
Num sum = 0
While count < 3
For X = 1 to 2 step 1
Sum = sum + X
Endfor
Count = count + 1
Endwhile

A) 3
B) 6
C) 9
D) 12
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
The following pseudocode is not working properly.The message should display 10 times.What needs to be changed? for count = 0 to 10
Output "I love programming!"
Endfor

A) The for statement should be:
For count = 0 to 9
B) The for statement should be:
For count = 0 to 9 step 1
C) The for statement should be:
For count = 0 to 10 step 1
D) The for statement should be:
For count = 0 to 8 step 1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
Name the three crucial steps that must occur in every loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
The following pseudocode is not working properly.The message should display 10 times.This is not working because the programmer made which common loop mistake? for count = 1 to 10
Output "Hello"
Endfor

A) Neglecting to initialize the loop control variable
B) Neglecting to alter the loop control variable
C) Using the wrong comparison with the loop control variable
D) Including statements inside the loop that belong outside the loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
Using a for loop,write the pseudocode to display "I love programming!" five times.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
Write the logic for a program that outputs every even number from 2 through 16.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
Name three common mistakes that programmers make when programming with loops.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.