Deck 4: The Sequence Structure
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
العب
ملء الشاشة (f)
Deck 4: The Sequence Structure
1
An advantage of structured programming is that it works well with the concept of modular programming.
True
2
An advantage of structured programming is that structures can be pulled out of programs and inserted into other programs without adversely affecting the flow of the surrounding code.
True
3
Structured programming is most often characterized by the GOTO statement, common in early line-number BASIC programs.
False
4
Structures are easy to find and change: They have one entry point and one exit point-a clear beginning and end.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
Procedural programming is widely accepted as the most efficient method of program development, resulting in faster development, reusable code, easier maintenance, and fewer errors.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
When code is not written by using modules, it is difficult to know what effect changing a line of code will have on surrounding statements.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
Structured programming is commonly called "spaghetti code."
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
The "stored programming" concept developed by John von Neumann states that any program can be written by using only sequence, selection, and repetition structures.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
The following is an example of a nonstructured program:
100 PRINT "Enter a number (or 0 to quit): "
110 INPUT N
120 WHILE N <> 0
120 IF N < 0 THEN PRINT "Your number is negative."
130 IF N > 0 THEN PRINT "Your number is positive."
140 PRINT "Enter a number (or 0 to quit): "
150 INPUT N
160 END WHILE
200 PRINT "Thank you!"
100 PRINT "Enter a number (or 0 to quit): "
110 INPUT N
120 WHILE N <> 0
120 IF N < 0 THEN PRINT "Your number is negative."
130 IF N > 0 THEN PRINT "Your number is positive."
140 PRINT "Enter a number (or 0 to quit): "
150 INPUT N
160 END WHILE
200 PRINT "Thank you!"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
Statements in a sequence structure are performed without any conditions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
On a flowchart, a variable declaration is considered a process, so it is placed in a parallelogram.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
On a flowchart, symbols are connected by flowlines that indicate the order of processing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
Flowcharts can be drawn to move from top to bottom or from left to right, whichever fits the page better.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
Modules (which include methods and functions) are sections of programming code, and as a result, they are made up of sequence, selection, and repetition structures, just as other program code is.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
The computer always processes comments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
Comments are included in programs to aid the programmer.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
Every time a module is called, the computer suspends execution of the main program, runs the module, and then returns to the next statement in the main program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
Modules are represented by rectangles with stripes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
Modular programming helps keep your main program uncluttered and easy to understand.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
Right-brained people tend to favor pseudocode as a method of developing algorithms for programs
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
Left-brained people tend to favor flowcharts as a method of developing algorithms for programs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
"Accessor" methods are also called "get" methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
Methods that assign values to class variables are called "accessor" methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
Class methods that return values to the calling module are called "mutator" methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
"Mutator" methods are also called "set" methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
____ is a way of designing, writing, and modifying programs that focuses on this core concept: Use only the three recognized control structures-sequence, selection, and repetition.
A) Procedural programming
B) Structured programming
C) Object oriented programming
D) Nonstructured programming
A) Procedural programming
B) Structured programming
C) Object oriented programming
D) Nonstructured programming
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
A ____ structure consists of one or more statements performed in order with no variation.
A) selection
B) sequence
C) repetition
D) nested
A) selection
B) sequence
C) repetition
D) nested
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
The ____ structure evaluates a logical condition, one that's true or false, then performs one or more statements (or ignores those statements), based on the evaluation of this condition.
A) selection
B) sequence
C) repetition
D) nested
A) selection
B) sequence
C) repetition
D) nested
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
A ____ structure evaluates a logical condition and performs or ignores one or more statements based on the evaluation.
A) selection
B) sequence
C) repetition
D) nested
A) selection
B) sequence
C) repetition
D) nested
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
The following statement is an example of a(n) ____ structure.
"Go to the grocery store. Buy milk and eggs. Get gas in the car on the way home."
A) selection
B) sequence
C) repetition
D) nested
"Go to the grocery store. Buy milk and eggs. Get gas in the car on the way home."
A) selection
B) sequence
C) repetition
D) nested
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
The following statement is an example of a(n) ____ structure.
"Deposit $100 into savings every week, as long as your balance is below $1000."
A) selection
B) sequence
C) repetition
D) nested
"Deposit $100 into savings every week, as long as your balance is below $1000."
A) selection
B) sequence
C) repetition
D) nested
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
The following statement is an example of a(n) ____ structure.
"If it's raining outside, take an umbrella."
A) selection
B) sequence
C) repetition
D) nested
"If it's raining outside, take an umbrella."
A) selection
B) sequence
C) repetition
D) nested
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
The following statement is an example of a(n) ____ structure.
"For one week, you will pay $3 for a subway ticket. After that, you will receive a discount."
A) selection
B) sequence
C) repetition
D) nested
"For one week, you will pay $3 for a subway ticket. After that, you will receive a discount."
A) selection
B) sequence
C) repetition
D) nested
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
The following statement is an example of a(n) ____ structure.
"If the baby gets sick, take her to the hospital."
A) selection
B) sequence
C) repetition
D) nested
"If the baby gets sick, take her to the hospital."
A) selection
B) sequence
C) repetition
D) nested
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
The following statement is an example of a(n) ____ structure.
"Do your homework, then watch t.v."
A) selection
B) sequence
C) repetition
D) nested
"Do your homework, then watch t.v."
A) selection
B) sequence
C) repetition
D) nested
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
A common example used for a sequence structure is the ______ part of a recipe.
A) ingredient list
B) preparation time
C) instruction
D) optional
A) ingredient list
B) preparation time
C) instruction
D) optional
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
Which of the following correctly converts the algorithm below to JavaScript? (Assume that constants for an empty string (ES) and the line break tag (BR) have been declared.)
Display "Enter your full name: "
Input fullName
Display "Enter your age in years: "
Input age
Display "Hi, " + fullName
Display "You are " + age + " years old."
A) fullName = prompt("Enter your full name:",ES);
Age = prompt("Enter your age in years:",ES);
B) fullName = prompt("Enter your full name:",ES);
Age = prompt("Enter your age in years:",ES);
Document("Hi, " + fullName + BR);
Document("You are " + age + "years old." + BR);
C) fullName = prompt("Enter your full name:",ES);
Age = prompt("Enter your age in years:",ES);
Document.write("Hi, " + fullName + BR);
D) fullName = prompt("Enter your full name:",ES);
Age = prompt("Enter your age in years:",ES);
Document.write("Hi, " + fullName + BR);
Document.write("You are " + age + "years old." + BR);
Display "Enter your full name: "
Input fullName
Display "Enter your age in years: "
Input age
Display "Hi, " + fullName
Display "You are " + age + " years old."
A) fullName = prompt("Enter your full name:",ES);
Age = prompt("Enter your age in years:",ES);
B) fullName = prompt("Enter your full name:",ES);
Age = prompt("Enter your age in years:",ES);
Document("Hi, " + fullName + BR);
Document("You are " + age + "years old." + BR);
C) fullName = prompt("Enter your full name:",ES);
Age = prompt("Enter your age in years:",ES);
Document.write("Hi, " + fullName + BR);
D) fullName = prompt("Enter your full name:",ES);
Age = prompt("Enter your age in years:",ES);
Document.write("Hi, " + fullName + BR);
Document.write("You are " + age + "years old." + BR);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
On a flowchart, ____ mark the beginning and ending of the flowchart.
A) terminal symbols
B) process symbols
C) input/output symbols
D) module symbols
A) terminal symbols
B) process symbols
C) input/output symbols
D) module symbols
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
On a flowchart, ____ are used for variable declarations or assignment statements.
A) terminal symbols
B) process symbols
C) module symbols
D) input/output symbols
A) terminal symbols
B) process symbols
C) module symbols
D) input/output symbols
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
On a flowchart, ____ are used for display statements, prompts, and input statements.
A) terminal symbols
B) process symbols
C) module symbols
D) input/output symbols
A) terminal symbols
B) process symbols
C) module symbols
D) input/output symbols
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
On a flowchart, ____ are used for connecting other symbols.
A) terminal symbols
B) process symbols
C) module symbols
D) flow lines
A) terminal symbols
B) process symbols
C) module symbols
D) flow lines
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
On a flowchart, ____ are used for comments.
A) terminal symbols
B) process symbols
C) annotation boxes
D) flow lines
A) terminal symbols
B) process symbols
C) annotation boxes
D) flow lines
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
On a flowchart, the Start and Stop keywords, used to indicate the beginning and end of a pseudocode program, are represented by ____.
A) rectangles
B) annotation boxes
C) parallelograms
D) terminal symbols
A) rectangles
B) annotation boxes
C) parallelograms
D) terminal symbols
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
In the algorithm below, adding 10 years to the age variable and storing the result in the newAge variable is an assignment statement, so on a flowchart, it is placed in a(n) ____.
Start
// Declare variables
Declare Numeric age, newAge
// Get user's age
Display "Please enter your age: "
Input age
// Compute age in 10 years
NewAge = age + 10
// Display new age
Display "In 10 years, you will be " + newAge
Stop
A) rectangle
B) parallelogram
C) terminal symbol
D) annotation box
Start
// Declare variables
Declare Numeric age, newAge
// Get user's age
Display "Please enter your age: "
Input age
// Compute age in 10 years
NewAge = age + 10
// Display new age
Display "In 10 years, you will be " + newAge
Stop
A) rectangle
B) parallelogram
C) terminal symbol
D) annotation box
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
In the algorithm below, the Display statement for the result is considered output, so on a flowchart, it is placed in a ____.
Start
// Declare variables
Declare Numeric age, newAge
// Get user's age
Display "Please enter your age: "
Input age
// Compute age in 10 years
NewAge = age + 10
// Display new age
Display "In 10 years, you will be " + newAge
Stop
A) rectangle
B) parallelogram
C) terminal symbol
D) annotation box
Start
// Declare variables
Declare Numeric age, newAge
// Get user's age
Display "Please enter your age: "
Input age
// Compute age in 10 years
NewAge = age + 10
// Display new age
Display "In 10 years, you will be " + newAge
Stop
A) rectangle
B) parallelogram
C) terminal symbol
D) annotation box
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
On a flowchart, assignment statements appear in ____.
A) rectangles
B) parallelograms
C) terminal symbols
D) annotation boxes
A) rectangles
B) parallelograms
C) terminal symbols
D) annotation boxes
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
Look at the following pseudoocode and insert the missing statement:
Start
// Declare variables
Declare String lastName, firstName, fullName
// Input last and first names
Display "Enter your last name: "
Input lastName
Display "Enter your first name: "
Input firstName
// Concatenate names with space in between
____
// Display full name
Display "Your full name is " + fullName
Stop
A) fullName = firstName + lastName
B) fullName = firstName + " " + lastName
C) fullName = firstName, lastName
D) fullName = firstName, space, lastName
Start
// Declare variables
Declare String lastName, firstName, fullName
// Input last and first names
Display "Enter your last name: "
Input lastName
Display "Enter your first name: "
Input firstName
// Concatenate names with space in between
____
// Display full name
Display "Your full name is " + fullName
Stop
A) fullName = firstName + lastName
B) fullName = firstName + " " + lastName
C) fullName = firstName, lastName
D) fullName = firstName, space, lastName
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
The JavaScript equivalent of the pseudocode Input is ____.
A) var
B) document.write()
C) new
D) prompt()
A) var
B) document.write()
C) new
D) prompt()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
The JavaScript equivalent of the pseudocode Declare is ____.
A) var
B) document.write()
C) new
D) prompt()
A) var
B) document.write()
C) new
D) prompt()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
The JavaScript equivalent of the pseudocode Display is ____.
A) var
B) document.write()
C) new
D) prompt()
A) var
B) document.write()
C) new
D) prompt()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck