CS 1MD3 T2 2004
Assignments
Some assignments will be handed in using WebCT. Your MUSS userid is your userid for
WebCT as well.
It seems that in some of the labs (like ABB), cygwin is already installed. I
definitely recommend learning VIM (or emacs) for editing programs. It takes a bit
of time, but the long-term rewards are definitely worth it!
- Translate some C code to Pascal. The
code is also available as
text file for easier editing. It appears that
"free Pascal" is installed in all the labs, so you can make sure your
programs are correct. The marking scheme will definitely deduct marks
for syntactically incorrect programs!
- The exact details of assignment 2 are
on another page.
- The exact details of assignment 3 are
on another page.
- The exact details of assignment 4 are
on another page.
- The exact details of assignment 5 are
on another page.
Bonus Assignments
First
The first bonus assignment, due Thursday February 26th [by email, to me,
any time on the 26th]
consists in writing several version of quicksort:
- plain quicksort for integers
- quicksort for an Abstract Data Type
- quicksort for an Abstract Data Type, and a specific comparison
function
- quicksort for an Abstract Data Type, a specific comparison
function and a specific partition function.
Each of the above versions of quicksort should be written in
C,
Java,
Haskell and
Prolog. Note that the
plain version of quicksort is not worth any bonus marks, as it
is expected that you will use a standard version of this algorithm that
you can find many places on the web. You should include comments for
each of your code versions, clearly explaining the design decisions you
have made, why you made them, etc. This assignment is to be done
individually!.
This bonus assignment can be worth several percentage points on
your final mark - outstanding submissions could earn up to 5%
Second
Due (by email) any time before the exam.
The references for
javap,
the JVM (and more downloadable from
the Java documenation page) will come in quite handy.
Write, in C a version of javap. In other words,
your program should read in a (binary) Java .class file (given as
a file name on the command line) and print the 'decompilation' of
the class file as output.
The only things to mimic are javap called with only a class
file as input, or with the -c option.
Deliverables:
- The C program, and test files that are known to work.
This assignment will be worth a sliding amount depending
on the functionality provided.
This assignment is very difficult if you try to "just code it".
However, if you think it through and use (many) of the data-structures
from class, including a finite-state machine or two, as well as
table-based dispatch, this is not so bad. It can be done in
around 300 lines of actual code and maybe 200 lines of data
definitions (op-codes, keywords, etc). To be precise: use a
finite state machine with an auxilliary stack, where you use
the stack to store state transitions. Use (lots) of data tables.
Very complicated and/or very long solutions will be worth
much fewer points than a thought-through concise solution.
Back to main page