Deck 3: Ifthenelse Control Structure

Full screen (f)
exit full mode
Question
A diamond shape symbol on a program flowchart represents a decision to be made.
Use Space or
up arrow
down arrow
to flip the card.
Question
The keyword ELSE is not needed when writing the pseudcode of a null ELSE.
Question
If the variable named ANSWER has a value of 1,what will be output after the instructions corresponding to the following pseudocode are executed?
IF ANSWER =1THEN= 1 \mathrm { THEN } Write "Hello"
(ELSE)
ENDIF\mathrm { ENDIF }
IF ANSWER =2= 2 THEN
Write "Goodbye"
ELSE
Write "Good day",
ENDIF

A)Hello
B)Goodbye
C)Good day
D)both a and c
Question
Which of the following terms is an example of a character-string constant?

A)123
B)ABC
C)GRADE
D)none of the above
Question
Which program flowcharting symbol is used as a collector,emphasizing the single exit point of an IFTHEN control structure?

A)decision
B)connector
C)terminal interrupt
D)process
Question
An algorithm can be expressed by the use of an informal language called

A)BASIC
B)Visual Basic
C)pseudocode
D)flowcharting
Question
If the variable named AVG has a value of 73,what is the value of GRADE after the instructions corresponding to the following pseudocode are executed?
IF AVG>93THEN\mathrm { AVG } > 93 \mathrm { THEN }
GRADE == "A"
ELSE
GRADE == "B"
ENDIF
IF AVG>73\mathrm { AVG } > 73 THEN
GRADE == "C"
ELSE
GRADE == "F"
ENDIF

A)A
B)B
C)C
D)F
Question
If the variable named AVG has a value of 93,what is the value of GRADE after the instructions corresponding to the following pseudocode are executed?
IF AVG>93A V G > 93 THEN
GRADE = "A"
ELSE
IF AVG>83A V G > 83 THEN
ELSE  GRADE = "B"  GRADE = "P", \begin{array} { l } \text { GRADE } = \text { "B" } \\ \text { GRADE } = \text { "P", } \end{array}
ENDIF
ENDIF

A)A
B)B
C)C
D)F
Question
Which program flowcharting symbol is used to indicate a choice between two alternative paths?

A)process
B)general input/output
C)terminal interrupt
D)decision
Question
If the variable named AVG has a value of 73,what is the value of GRADE after the instructions corresponding to the following pseudocode are executed?
IF AVG >93> 93 THEN
GRADE = "A"
ELSE
IF AVG>83\mathrm { AVG } > 83 THEN
GRADE = "B"
ELSE
GRADE = "P"
ENDIF
ENDIF

A)A
B)B
C)P
D)none of the above
Question
The no-function condition is usually called a null ELSE.
Question
If the variable named ANSWER has a value of 1,what will be output after the instructions corresponding to the following pseudocode are executed?
IF ANSWER =1= 1 THEN
Write "Hello"
ELSE
IF ANSWER =2= 2 THEN
Write "Goodbye"
ELSE
Write "Good day"
ENDIF
ENDIF

A)Hello
B)Goodbye
C)Good day
D)both a and c
Question
If no special alternative action is required when the condition tested in an IFTHENELSE pattern is false,we refer to this as a

A)null ELSE
B)IFTHENELSE
C)conditional branch
D)nested pattern
Question
The following pseudocode
IF AVG >93> 93 THEN GRADE = "A" ELSE
GRADE = "B"
ENDIF
IF AVG>73\mathrm { AVG } > 73 THEN
GRADE == " C\mathrm { C } ",
ELSE
GRADE = "F "
ENDIF
Represents a

A)sequential IFTHENELSE pattern
B)nested IFTHENELSE pattern
C)null IFTHENELSE pattern
D)simple IFTHENELSE pattern
Question
In a nested IFTHENELSE pattern,all the tests are always made,one after the other.
Question
In a sequential IFTHENELSE pattern,whether tests after the first one are made depends upon the outcome of the preceding tests.
Question
The following pseudocode
IF AVG >93> 93 THEN
GRADE == "A"
ELSE
IF AVG>83A V G > 83 THEN
GRADE == "B"
ELSE
GRADE == "P"
ENDIF
ENDIF
Represents a

A)sequential IFTHENELSE pattern
B)nested IFTHENELSE pattern
C)null IFTHENELSE pattern
D)simple IFTHENELSE pattern
Question
The following pseudocode
IF AVG >93> 93 THEN GRADE == "A"
(ELSE)
ENDIF
Represents a

A)sequential IFTHENELSE pattern
B)nested IFTHENELSE pattern
C)null IFTHENELSE pattern
D)simple IFTHENELSE pattern
Question
If the variable named AVG has a value of 93,what is the value of GRADE after the instructions corresponding to the following pseudocode are executed?
IF AVG>93THEN\mathrm { AVG } > 93 \mathrm { THEN }
 GLSA  GRE = "A"  GRADE =" B"\begin{array} { l } \text { GLSA } \quad \text { GRE } = \text { "A" } \\ \text { GRADE } = " \mathrm {~B} " \end{array}
ENDIF
IF AVG>73THEN\mathrm { AVG } > 73 \mathrm { THEN }
GRADE == " C\mathrm { C } ",
ELSE
GRADE = "F"'
ENDIF

A)A
B)B
C)C
D)F
Question
If the variable named GRADE has a value of 95,which of the following statements will cause the line
95 is above average
To be output?

A)Write "GRADE is above average"
B)Write GRADE is above average
C)Write GRADE,"is above average"
D)Write "GRADE,is above average"
Question
A connector symbol is placed at the entry point of an IFTHENELSE control structure.
Question
The value of a character-string constant is usually enclosed in either single or double quotes.
Question
Indentation is used in pseudocode to improve readability.
Question
A nested IFTHENELSE pattern cannot contain a null ELSE.
Question
The decision point in an IFTHENELSE statement is called an unconditional branch.
Question
Pseudocode is a graphic depiction of an algorithm.
Question
The statements Write A and Write "A" will always produce the same output.
Question
Pseudocode may be a more suitable tool than flowcharting when working on complex problems.
Question
In a nested IFTHENELSE pattern,it is probable that many of the tests will be skipped.
Question
There is no ANSI-approved standard for pseudocode.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/30
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: Ifthenelse Control Structure
1
A diamond shape symbol on a program flowchart represents a decision to be made.
True
2
The keyword ELSE is not needed when writing the pseudcode of a null ELSE.
False
3
If the variable named ANSWER has a value of 1,what will be output after the instructions corresponding to the following pseudocode are executed?
IF ANSWER =1THEN= 1 \mathrm { THEN } Write "Hello"
(ELSE)
ENDIF\mathrm { ENDIF }
IF ANSWER =2= 2 THEN
Write "Goodbye"
ELSE
Write "Good day",
ENDIF

A)Hello
B)Goodbye
C)Good day
D)both a and c
both a and c
4
Which of the following terms is an example of a character-string constant?

A)123
B)ABC
C)GRADE
D)none of the above
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
5
Which program flowcharting symbol is used as a collector,emphasizing the single exit point of an IFTHEN control structure?

A)decision
B)connector
C)terminal interrupt
D)process
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
6
An algorithm can be expressed by the use of an informal language called

A)BASIC
B)Visual Basic
C)pseudocode
D)flowcharting
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
7
If the variable named AVG has a value of 73,what is the value of GRADE after the instructions corresponding to the following pseudocode are executed?
IF AVG>93THEN\mathrm { AVG } > 93 \mathrm { THEN }
GRADE == "A"
ELSE
GRADE == "B"
ENDIF
IF AVG>73\mathrm { AVG } > 73 THEN
GRADE == "C"
ELSE
GRADE == "F"
ENDIF

A)A
B)B
C)C
D)F
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
8
If the variable named AVG has a value of 93,what is the value of GRADE after the instructions corresponding to the following pseudocode are executed?
IF AVG>93A V G > 93 THEN
GRADE = "A"
ELSE
IF AVG>83A V G > 83 THEN
ELSE  GRADE = "B"  GRADE = "P", \begin{array} { l } \text { GRADE } = \text { "B" } \\ \text { GRADE } = \text { "P", } \end{array}
ENDIF
ENDIF

A)A
B)B
C)C
D)F
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
9
Which program flowcharting symbol is used to indicate a choice between two alternative paths?

A)process
B)general input/output
C)terminal interrupt
D)decision
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
10
If the variable named AVG has a value of 73,what is the value of GRADE after the instructions corresponding to the following pseudocode are executed?
IF AVG >93> 93 THEN
GRADE = "A"
ELSE
IF AVG>83\mathrm { AVG } > 83 THEN
GRADE = "B"
ELSE
GRADE = "P"
ENDIF
ENDIF

A)A
B)B
C)P
D)none of the above
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
11
The no-function condition is usually called a null ELSE.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
12
If the variable named ANSWER has a value of 1,what will be output after the instructions corresponding to the following pseudocode are executed?
IF ANSWER =1= 1 THEN
Write "Hello"
ELSE
IF ANSWER =2= 2 THEN
Write "Goodbye"
ELSE
Write "Good day"
ENDIF
ENDIF

A)Hello
B)Goodbye
C)Good day
D)both a and c
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
13
If no special alternative action is required when the condition tested in an IFTHENELSE pattern is false,we refer to this as a

A)null ELSE
B)IFTHENELSE
C)conditional branch
D)nested pattern
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
14
The following pseudocode
IF AVG >93> 93 THEN GRADE = "A" ELSE
GRADE = "B"
ENDIF
IF AVG>73\mathrm { AVG } > 73 THEN
GRADE == " C\mathrm { C } ",
ELSE
GRADE = "F "
ENDIF
Represents a

A)sequential IFTHENELSE pattern
B)nested IFTHENELSE pattern
C)null IFTHENELSE pattern
D)simple IFTHENELSE pattern
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
15
In a nested IFTHENELSE pattern,all the tests are always made,one after the other.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
16
In a sequential IFTHENELSE pattern,whether tests after the first one are made depends upon the outcome of the preceding tests.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
17
The following pseudocode
IF AVG >93> 93 THEN
GRADE == "A"
ELSE
IF AVG>83A V G > 83 THEN
GRADE == "B"
ELSE
GRADE == "P"
ENDIF
ENDIF
Represents a

A)sequential IFTHENELSE pattern
B)nested IFTHENELSE pattern
C)null IFTHENELSE pattern
D)simple IFTHENELSE pattern
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
18
The following pseudocode
IF AVG >93> 93 THEN GRADE == "A"
(ELSE)
ENDIF
Represents a

A)sequential IFTHENELSE pattern
B)nested IFTHENELSE pattern
C)null IFTHENELSE pattern
D)simple IFTHENELSE pattern
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
19
If the variable named AVG has a value of 93,what is the value of GRADE after the instructions corresponding to the following pseudocode are executed?
IF AVG>93THEN\mathrm { AVG } > 93 \mathrm { THEN }
 GLSA  GRE = "A"  GRADE =" B"\begin{array} { l } \text { GLSA } \quad \text { GRE } = \text { "A" } \\ \text { GRADE } = " \mathrm {~B} " \end{array}
ENDIF
IF AVG>73THEN\mathrm { AVG } > 73 \mathrm { THEN }
GRADE == " C\mathrm { C } ",
ELSE
GRADE = "F"'
ENDIF

A)A
B)B
C)C
D)F
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
20
If the variable named GRADE has a value of 95,which of the following statements will cause the line
95 is above average
To be output?

A)Write "GRADE is above average"
B)Write GRADE is above average
C)Write GRADE,"is above average"
D)Write "GRADE,is above average"
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
21
A connector symbol is placed at the entry point of an IFTHENELSE control structure.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
22
The value of a character-string constant is usually enclosed in either single or double quotes.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
23
Indentation is used in pseudocode to improve readability.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
24
A nested IFTHENELSE pattern cannot contain a null ELSE.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
25
The decision point in an IFTHENELSE statement is called an unconditional branch.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
26
Pseudocode is a graphic depiction of an algorithm.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
27
The statements Write A and Write "A" will always produce the same output.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
28
Pseudocode may be a more suitable tool than flowcharting when working on complex problems.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
29
In a nested IFTHENELSE pattern,it is probable that many of the tests will be skipped.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
30
There is no ANSI-approved standard for pseudocode.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 30 flashcards in this deck.