Homework Assignment 4
Answer all of the following questions using either a word processor or
text editor and submit your homework as either a pdf file or an ascii
text file. Use the submission script to submit your assignment.
- Explain the distinction between compilation and interpretation. What
are the comparative advantages and disadvantages of the two approaches?
- What is the difference between a compiler and a preprocessor?
- List the principal phases of compilation, and describe the work
performed by each phase.
- What distinguishes the front end of a compiler from the back end?
- In C++, how can I inherit a class's implementation without inheriting
- These questions all concern types:
- What is a type?
- What is a subtype?
- What is the relationship between an interface and a type?
- What is the relationship between a class and a type?
- What is the relationship between a subclass and a type?
- What is the difference between replicated inheritance and
shared inheritance. What is the default type of inheritance
- What is polymorphism? As discussed in class,
what is the difference between inheritance
polymorphism and parametric polymorphism?
- Write regular expressions to describe the following
set of tokens. Please use the notation used in class, although
if you have used Perl, it is acceptable to use \d to
represent the digits 0-9.
- Calendar dates of the form mm/dd/yyyy. Months and days may be either
1 or 2 digits. Years must be four digits. Do not worry about
out-of-range dates such as 24/88/3005.
- Html header tags that start with h1, h2, or h3, then have a header
with letters, numbers, blank spaces, and dashes, and end with
a /h1, /h2, or /h3. For example <h2>Super Bowl-41</h2>
is a valid header but <h2>Super Bowl-41</h3> is not
because of the non-matching header tags and
<h2>Super Bowl: 41</h2> is not because of the :.
- Scott #2.1c
- Scott #2.1f