April 3, 2016

Objective. The purpose of this assignment1 is to create a symbol table data type whose
keys are two-dimensional points. We’ll use a 2d-tree to support ecient range search (nd
all the points contained in a query rectangle) and k-nearest neighbor search (nd k points
that are closest to a query point). 2d-trees have numerous applications, ranging from
classifying astronomical objects to computer animation to speeding up neural networks
to mining data to image retrieval.
Geometric Primitives. Use the immutable data type Point2D for points in the plane.
Here is the subset of its API that you may use:
p u b l i c c l a s s P o i n t 2 D i m p l e m e n t s C o m p a r a b l e < Point2D >
// C o n s t r u c t the p o i n t ( x , y ).
P o i n t 2 D ( d o u b l e x , d o u b l e y )
// x – c o o r d i n a t e .

November 17, 2015
CSCI212 assignment3 solution: shell interpreter implementation


Assignment 3 (7.5 marks)

Due 11:59pm Sunday May 17, 2015.

The aim of this assignment is to write a simple shell interpreter demonstrating you knowledge of process

control. In addition to this you will get some experience with file system API’s.

Task One (4.5 marks)

You first task is to write a simple shell interpreter, which executes commands. You shell interpreter should

display a $ prompt and wait for user input.

You shell interpreter is to be a little simplistic, all you can do is execute commands. If a command cannot be

found you should display a suitable error message. When executing a command the shell interpreter should

wait until the command terminates. To implement command execution simply use the function call fork()

and exec(). Note that there are many variations on the exec() function call. To block the shell, you

should use the wait() (or similar) function call.

At the end of this step you should be able to do this:

$ ./foobar

./foobar does not exist.

$ ls –la