Sample Exam 3
True/False
Indicate whether the sentence or statement is true or false.
____ 1. The head section of a Web page defines what appears within the browser window.
____ 2. Two dollar signs ($$) next to one another is Perl's numeric relational operator that stands for equality.
____ 3. In C, customer_name is an example of a legal identifier.
____ 4. Key words have special meanings so you cannot use them as names for variables or functions.
Modified True/False
Indicate whether the sentence or statement is true or false. If false, change the identified word or phrase to make the sentence or statement true.
____ 5. The loopback feature allows your UNIX or Linux system to access its own internal network configuration instead of an external network. _________________________
____ 6. Most high-level programming languages, such as Perl, use filehandles to reference files. _________________________
____ 7. Scalar variable names begin with a(n) # sign. _________________________
____ 8. Identifiers are names given to variables and functions. _________________________
Multiple Choice
Identify the letter of the choice that best completes the statement or answers the question.
____ 9. Which of the following operators tests two numeric values for “not equal to”?
a. |
!== |
c. |
!= |
b. |
<> |
d. |
== |
____ 10. When used in a double-quoted string, which of the following control characters places a horizontal tab in the displayed output?
a. |
\t |
c. |
\a |
b. |
\h |
d. |
\n |
____ 11. In the Awk program, which of the following options tells the shell that the program is being called with a script file that contains the awk command?
a. |
-A |
c. |
-s |
b. |
-a |
d. |
-f |
____ 12. Which of the following format specifiers to printf() represents a signed decimal integer?
a. |
#i |
c. |
%i |
b. |
$i |
d. |
-i |
____ 13. The first character in a C identifier must be either a letter or a(n) ____.
a. |
digit |
c. |
ampersand (&) |
b. |
underscore (_) |
d. |
percent sign (%) |
Yes/No
Indicate whether you agree with the sentence or statement.
____ 14. Does Awk require a programmer to explicitly set up looping structures to search through a file?
____ 15. Are C programs made up of a single large function?
Completion
Complete each sentence or statement.
16. When you access your own computer through a loopback (when testing HTML documents for example), _________________________ is the name used for the computer.
17. To specify an output file name to the C compiler (other than the default name, a.out), you would use the ____________________option.
18. The word ____________________ in a function definition indicates that the function does not return a value.
19. The scope of a(n) ____________________ variable in a C program is the entire program.
Matching
Identify the correct word with its corresponding definition.
a. |
Scope |
f. |
scanf() |
b. |
Function prototype |
g. |
while |
c. |
for |
h. |
fopen() |
d. |
do-while |
i. |
fgetc() |
e. |
feof() |
|
____ 20. Tells the compiler that a specific function will be defined later in the program.
____ 21. A C function that opens a file.
____ 22. A C function that reads a single character from a file.
____ 23. A C looping statement that is used when you know the number of iterations.
____ 24. A C function used to input values of a variety of data types.
Short Answer
25. What is the purpose of a linker?
26. What is the purpose of the C library?
27. Write a perl program to prompt the user for a file name, open the file and print each line aftre changing all letters to lower case.
28. Write a perl program to read lines from a command line paremeter which is the name of a comma separated (commas separate fields) file and display the uniq values in the first field along with the number of times the values occur each on a line separated by a tab.
29. Write an awk program to solve problem 28.