Programming Lab #1:Assigned: Thu 12 Feb 1998
For this project you will write a program which:
Note also that you will not have to print the tree in a
level-order fashion, using a queue, as we discussed in class: this would probably
be too difficult for a first assignment. Instead, you are only required to print the
tree in an indented outline style, using tabs and returns. Each node should be
tabbed in as many times as it is levels deep in the tree, with the children of any
given node printed below it. The left child of a node should be printed on the line
immediately below that node, but indented one tab further, followed by the
descendants of that child, then followed by the right child and its descendants.
For example, the following tree would correspond to the output shown below:
For more details, see the various sections below.
We will be using Symantec Cafe (Java) under Windows 95 for programming projects
this semester. You should already be familiar with the use of this environment,
either from a previous course or from self-study during the "lead time" that was
granted during the frist few weeks of class. If you are not familiar with Java
or Symantec Cafe, you may wish to pair up with a student who is.
Under such circumstances, it would be unwise for either party to allow the
Java-knowledgable partner to dominate the coding aspects of the lab
Input, output and error-checking
I will provide sample input and output files in a class directory by this
weekend; the sample given above should serve until then.
You should write some of your own test inputs for debugging purposes in any case.
For convenience, your program should be able to read
and process multiple successive input expressions until, say,
the end of the input stream is reached.
If there is any sort of error in a given expression, you should note it and
continue to read in more expressions. Errors you should catch include:
Note that I will be likely ask you to demonstrate your program on samples
other than the ones provided in the directory mentioned above; be prepared.
Your project will be assessed on the basis of both a "live" demonstration
and a hard copy description and print-out of the project code.
The printed version
should specify both members of your group and should specifically mention any free
late days used, remaining problems or bugs, special enhancements, etc. In addition
to "raw code", you should include a brief introduction describing anything that is
special in your approach to the problem (bugs, enhancements, etc., should also be
mentioned here).
I will be available in lab on Monday mornings from 10:00 - 11:30 for demonstrations.
You may also demonstrate at other times (Thursday morning office hours will likely
be popular), including by appointment, but you must demonstrate your project and hand
in your hard copy by the due date unless you receive a specific provision otherwise
(see also the information about free late days on the syllabus).
You may work in groups of two; this is not an absolute requirement, but is strongly
recommended. If you cannot find a partner, please see me and I will make arrangements.
Part of the goal of the programming projects in this course is to give you the
opportunity to develop some significant programs, and thus to exercise both your
design and coding skills. If you find that the assignment is not challenging enough
and you wish to do some extra work, there are a number of things you could do to
"add value" to the assignment, say for example printing out the infix version
of the expression or (more ambitiously) drawing the tree in a graphics window.
In any case, no such enhancements are required: enhanced versions of projects
may help your grade a bit, but you will have the
opportunity to earn an "A" in the course even if you only meet the minimum
assignment requirements.
|