Test Questions

advertisement
UNIX Chapter 7 Test bank
Test Questions
1.
In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "F" represents
a(n) ______________.
a. magnetic disk
b. offpage connector
c. input/output
d. terminator
2.
In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "E" represents
a(n) ______________.
a. magnetic disk
b. offpage connector
c. input/output
d. terminator
3.
In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "C" represents
a(n) ______________.
a. connector
b. decision
c. process
d. offpage connector
4.
In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "B" represents
a(n) ______________.
a. connector
b. decision
c. process
d. offpage connector
5.
In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "A" represents
a(n) ______________.
a. connector
b. decision
c. process
d. offpage connector
6.
In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "G" represents
a(n) ______________.
a. magnetic disk
b. offpage connector
c. input/output
d. terminator
7.
In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "D" represents
a(n) ______________.
a. connector
b. offpage connector
c. input/output
d. terminator
1
UNIX Chapter 7 Test bank
8.
Using the test command, the _____ option checks to see if one integer is equal to another integer.
a. -eq
b. -gt
c. -lt
d. -ge
9.
Using the test command, the _____ option checks to see if one integer is greater than another integer.
a. -eq
b. -gt
c. -lt
d. -ge
10. Using the test command, the _____ option checks to see if one integer is less than or equal to another integer.
a. -eq
b. -le
c. -ne
d. -ge
11. Using the test command, the _____ option checks to see if one integer is greater than or equal to another integer.
a. -eq
b. -gt
c. -lt
d. -ge
12. Using the test command, the _____ option checks to see if one integer is less than another integer.
a. -eq
b. -gt
c. -lt
d. -ge
13. Using the test command, the _____ option checks to see if one integer is not equal to another integer.
a. -eq
b. -le
c. -ne
d. -ge
14. You can view the last commands exit status by typing the command: ____________.
a. show $?
b. echo $?
c. echo $exit
d. echo exit
15. The ______ option, of the test command, tests for a zero-length string.
a. -z
b. -n
c. -zl
d. -nl
16. The ______ option, of the test command, tests for a non-zero string length.
a. -z
b. -n
c. -zl
d. -nl
2
UNIX Chapter 7 Test bank
17. A computer program is developed by analyzing the best way to achieve the desired results.
a. true
b. false
18. Pseudocode instructions are similar to actual programming statements.
a. true
b. false
19. The arrows that connect the symbols represent the direction in which the program flows from one symbol to the next.
a. true
b. false
20. When developing a shell script, you must be responsible for ensuring that the correct shell is used to interpret your
script.
a. true
b. false
21. If the exit status is 0 (zero), the test result is false.
a. true
b. false
22. The exit status is normally detected in a script by the if statement or in a looping structure.
a. true
b. false
23. If the exit status is 1, the test result is true.
a. true
b. false
24. You can use the test command to determine if a string has a length of zero characters or a non-zero number of
characters.
a. true
b. false
25. The test command's Boolean operators let you combine multiple expressions with AND and OR relationships.
a. true
b. false
26. You can use the test command to determine if a directory exists.
a. true
b. false
27. The translate utility changes the standard input character by character.
a. true
b. false
28. A simple way to delete a record is using sed with the d option.
a. true
b. false
29. You can store the output of the clear command in a shell variable.
a. true
b. false
3
UNIX Chapter 7 Test bank
30. A function name differs from a variable name, because a function name is followed by a set of parentheses, and the
commands that comprise the function are enclosed in curly braces.
a. true
b. false
31. You can use shell functions to isolate reusable code sections.
a. true
b. false
32. Shell scripts can use a function name to execute the commands.
a. true
b. false
33. Arguments are passed to functions in the same manner as any other shell procedure.
a. true
b. false
34. You can load functions automatically by your .bash-profile or .bashrc files when you log on.
a. true
b. false
35. The wildcard character * can be used in a test command to test more than one file.
a. true
b. false
36. The _____________ is a logic diagram that uses a set of standard symbols that explain the program's sequence and
each action it takes.
37. After creating a flowchart, the next step in designing a program is to write _____________.
38. The __________ command makes preliminary checks of the UNIX internal environment and other useful
comparisons.
39. A(n) ____________ status is a numeric value that the test command returns to the operating system when it finishes.
40. The ________ operator, an option (Boolean operator) of the test command, combines two expressions and tests a
logical AND relationship between them.
41. The ________ operator, an option (Boolean operator) of the test command, negates the value of an expression.
42. The ________ operator, an option (Boolean operator) of the test command, tests a logical OR relationship.
43. The _____________ command is a useful housekeeping utility for clearing the screen before new screens appear.
44. A(n) _____________ is a sequence of commands or instructions that produces a desired result.
45. Because users do not always enter valid data, a program should always check its input to ensure the user has
entered acceptable information. This is known as input ____________.
46. A shell _____________ is a group of commands that is stored in memory and assigned a name.
47. The test command uses operators expressed as options to perform evaluations. What can the command be used to
do?
NOTE: Write essay answers on separate page.
4
UNIX Chapter 7 Test bank
Test Questions with Answers [answer (UNIX-Chapter#-Page#)]
1. c (UNIX-7-240) In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "F"
represents a(n) ______________.
2. a (UNIX-7-240) In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "E"
represents a(n) ______________.
3. a (UNIX-7-240) In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "C"
represents a(n) ______________.
4. b (UNIX-7-240) In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "B"
represents a(n) ______________.
5. c (UNIX-7-240) In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "A"
represents a(n) ______________.
6. d (UNIX-7-240) In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "G"
represents a(n) ______________.
7. b (UNIX-7-240) In Figure 7-2, when labelling the symbols from the top to the bottom with letters A to G, the symbol "D"
represents a(n) ______________.
8. a (UNIX-7-243) Using the test command, the _____ option checks to see if one integer is equal to another integer.
9. b (UNIX-7-243) Using the test command, the _____ option checks to see if one integer is greater than another integer.
10. b (UNIX-7-243) Using the test command, the _____ option checks to see if one integer is less than or equal to
another integer.
11. d (UNIX-7-243) Using the test command, the _____ option checks to see if one integer is greater than or equal to
another integer.
12. c (UNIX-7-243) Using the test command, the _____ option checks to see if one integer is less than another integer.
13. c (UNIX-7-243) Using the test command, the _____ option checks to see if one integer is not equal to another integer.
14. b (UNIX-7-243) You can view the last commands exit status by typing the command: ____________.
15. a (UNIX-7-244) The ______ option, of the test command, tests for a zero-length string.
16. b (UNIX-7-244) The ______ option, of the test command, tests for a non-zero string length.
17. a - true (UNIX-7-238) A computer program is developed by analyzing the best way to achieve the desired results.
18. a - true (UNIX-7-239) Pseudocode instructions are similar to actual programming statements.
19. a - true (UNIX-7-239) The arrows that connect the symbols represent the direction in which the program flows from
one symbol to the next.
20. a - true (UNIX-7-242) When developing a shell script, you must be responsible for ensuring that the correct shell is
used to interpret your script.
21. b - false (UNIX-7-243) If the exit status is 0 (zero), the test result is false.
22. a - true (UNIX-7-243) The exit status is normally detected in a script by the if statement or in a looping structure.
23. b - false (UNIX-7-243) If the exit status is 1, the test result is true.
24. a - true (UNIX-7-244) You can use the test command to determine if a string has a length of zero characters or a nonzero number of characters.
5
UNIX Chapter 7 Test bank
25. a - true (UNIX-7-246) The test command's Boolean operators let you combine multiple expressions with AND and OR
relationships.
26. a - true (UNIX-7-248) You can use the test command to determine if a directory exists.
27. a - true (UNIX-7-251) The translate utility changes the standard input character by character.
28. a - true (UNIX-7-254) A simple way to delete a record is using sed with the d option.
29. a - true (UNIX-7-259) You can store the output of the clear command in a shell variable.
30. a - true (UNIX-7-268) A function name differs from a variable name, because a function name is followed by a set of
parentheses, and the commands that comprise the function are enclosed in curly braces.
31. a - true (UNIX-7-268) You can use shell functions to isolate reusable code sections.
32. a - true (UNIX-7-268) Shell scripts can use a function name to execute the commands.
33. a - true (UNIX-7-268) Arguments are passed to functions in the same manner as any other shell procedure.
34. a - true (UNIX-7-270) You can load functions automatically by your .bash-profile or .bashrc files when you log on.
35. b - false (UNIX-) The wildcard character * can be used in a test command to test more than one file.
36. flowchart (UNIX 7-238) The _____________ is a logic diagram that uses a set of standard symbols that explain the
program's sequence and each action it takes.
37. pseudocode (UNIX 7-239) After creating a flowchart, the next step in designing a program is to write _____________.
38. test (UNIX 7-242) The __________ command makes preliminary checks of the UNIX internal environment and other
useful comparisons.
39. exit (UNIX 7-243) A(n) ____________ status is a numeric value that the test command returns to the operating
system when it finishes.
40. -a (UNIX 7-246) The ________ operator, an option (Boolean operator) of the test command, combines two
expressions and tests a logical AND relationship between them.
41. ! (UNIX 7-247) The ________ operator, an option (Boolean operator) of the test command, negates the value of an
expression.
42. -o (UNIX 7-246) The ________ operator, an option (Boolean operator) of the test command, tests a logical OR
relationship.
43. clear (UNIX 7-258) The _____________ command is a useful housekeeping utility for clearing the screen before new
screens appear.
44. algorithm (UNIX 7-259) A(n) _____________ is a sequence of commands or instructions that produces a desired
result.
45. validation (UNIX 7-265) Because users do not always enter valid data, a program should always check its input to
ensure the user has entered acceptable information. This is known as input ____________.
46. function (UNIX 7-268) A shell _____________ is a group of commands that is stored in memory and assigned a
name.
47. The test command uses operators expressed as options to perform evaluations. What can the command be used to
do?
The command can be used to: * Perform relational tests with integers* Test strings* Determine id a file exists and what
type or file it is* Perform Boolean tests
6
Download