Assignment 4, Primitive and array types
Due 9/23/03 12 noon
(To be done with your group)
- The textbook defines two kinds of scoping: static and dynamic. Use
this link to figure out if
MYSTERY uses static or dynamic
scoping. As in the previous assignment your write up should describe the
kind of scoping that MYSTERY
uses and provide evidence for your conclusions. You may submit no more
than two programs for this question. Programs that have parse errors
(i.e., syntax errors) do not count. Every additional program will cost
you 5% of the points for this question.
- A language with static type checking finds and reports all type
errors at compile time. A language with dynamically type checking
finds all type errors at run time. Use the link in the previous question
to determine if MYSTERY uses
static or dynamic type checking. As in the previous assignment your
write up should describe whether MYSTERY
uses static or dynamic type checking and provide evidence for your
conclusions. You may submit no more than two programs for this question.
Programs that have parse errors do not count. Every additional program
will cost you 5% of the points for this question.
- Does Java use static or dynamic type checking? Support your answer
either with quotes from the Java language definition (available in the
"interesting links" section of the class web page) or with examples and their
output (much like how you use the PL Detective) from a Java compiler.
- Section 6.5.3 defines five categories for subscribt binding of arrays.
- Based on an inspection of MYSTERY
syntax, what kind(s) of arrays does
mystery support? Support your answer with an explanation.
If you are not sure, explain which information you would need to make a
decision, and how this information would influence your final judgment.
- What kind(s) of arrays does C++ support? For each kind, provide an
example. Also discuss the kind of situation where each kind of C++ array
would be useful.
- Explain how associative arrays differ from arrays found in C++. Give
one example where associative arrays are more suitable than arrays found in
C++. Give one example where C++ arrays are more suitable than
associative array. Your examples should be accompanied by an explanation
and justification.