CS 430 Midterm Exam
Form A
Name ____________________________
with ada.text_io; |
static scope
rules |
dynamic scope rules |
the maximum number of significant digits in a real number |
|
the size of an array variable |
|
the location of a local variable |
|
the value of a constant |
|
the location of a function |
|
|
if ( p <> nil and p^.data = 10) then … |
|
if (p^.data = 10 and p <> nil) then … |
|
GO TO (53, 42, 1, 13, 20) X
|
num := 5; for i in 1..num loop ada.integer_text_io.put (i); num := 3; end loop; |
|
|
parameter passing by value |
|
parameter passing by reference |
|
parameter passing by result |
|
parameter passing by value-result |
|
|
<S> ::= <A> <A> ::= <A> + <A> <A> ::= <id> <id> ::= a | b | c |
|
|
|
|
|
What are the two methods of translation we have talked about?
|
|
Describe the major difference between them.
|
What is the result of adding X and N and storing the result in N in FORTRAN?
Describe what happens |
Tell why it happens |
What is the
result of adding X
and N and storing the result in X
in
Describe what happens |
Tell why it happens |
|
|
|
|
|
|
For two (2) of these types of statement, provide a
syntactically correct example in FORTRAN, Pascal or
statement: |
comment: |
statement: |
comment: |
1234567898765432123456789
READ (5, 13) X, Y, I, Z 13 FORMAT (F3.2, 1X, F7.3, I4, F2.1) WRITE (6, 14) X,Y,I,Z 14 FORMAT (1X, F5.2, 2X, F8.3, 1X, I5, 1X, F3.1) STOP END |
X |
Y |
|
I |
|
Z |
Output
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FORTRAN and Pascal are examples of procedural or imperative languages. What type of language is XSLT?
|
reserved words: |
key words: |
Which does each of the following languages use?
FORTRAN |
|
Pascal |
|
|
|
Java |
|
Language |
feature |
opinion |