591 Old Announcements
Fall 2004, David Matuszek
CIT 591 Study session
I have reserved Levine 307 on Tuesday, from 6pm to 8pm for
anyone who would like to get together and study for the final exam.
I expect to be there at least part of the time, but I'm not going
to present or anything. This is totally optional, of course.
Please try to get a good night's sleep before the exam. It's probably
more important to be awake and careful than to do last-minute cramming.
The final exam is Wednesday, December 22, 8:30 - 10:30, in David
Rittenhouse Labs A4.
As I said in class, the final will be comprehensive. If
you have heard a rumor that it isn't, it isn't based on anything
On the midterm I asked you to create a complete program, one line
at a time, according to comments I provided. The final exam has
a similar question, but this time the program creates and uses a
There are several questions that give you some code and ask you
to figure out what it computes or prints. Some of the code uses
interfaces, abstract classes, and inner classes.
There are questions about JUnit and Javadoc, as well as some questions
about Java operators and statements.
Finally, you will be asked to define one or more terms.
Last assignment (short token counter):
Remember, your program must pass all the tests in myJavaTokenCounterTest class, or it gets a grade of zero.
If you did not submit a passing program before midnight, December
14, you can still submit a program any time before the final exam.
Late programs will receive a late penalty and will not
be eligible for bonus points.
If you are interested in participating in the final contest, here
are the numbers to beat:
Following these: 2911, 2929, 2991, and several programs with non-comment
token counts above 3000. In addition, there are several "dark
horse" programs that have been submitted without giving the
token counts in the Blackboard comments (guys, it's time to start
reading the assignments!).
So far, I have verified only the program currently in first place,
which passes all my JUnit tests and is the length that it is claimed
to be (and there are some easy ways to make it even shorter!).
Remember, the final lab on December 10 is optional. You
can use this lab time to meet with your partner and discuss how
to further reduce your token count, if you wish. Remember, the last
day to turn in assignment 9 is December 14.
I've posted grade
averages for all the work that's been graded so far.
and MSE (Masters) Pizza Bash
6:15 pm on Thursday Dec. 9 in Levine 307
Not a correction this time, but an addition of some
more uncommon syntax to JavaTokenCounterTest.java
for use with the final assignment. Those of you that are working late
tonight: These additions will only be used for the final assignment,
not for assignment 8.
Yet another correction to JavaTokenCounterTest.java:
I wasn't checking punctuation counts at all--my verify
method ignored them. So even though one of my counts was wrong (in
testStatements()), my JUnit tests didn't catch the error. Fixed.
Extension: Assignment 8, Java Token Counter, is now due
before midnight, Monday, December 6. However, a new assignment
will be given out in Lab this Friday, and it will
depend on your Java Token Counter.
Dave Millar, University of Pennsylvania Information Security
Officer, will talk on personal computer security: that is, how
avoid (or recover from) problems such as viruses, spyware, spam,
and phishing. This talk is aimed at a general audience.
All interested students and faculty are invited to attend.
Thursday, December 2 -- First talk
in MCIT Lecture Series
Thursday, December 9 -- Next pizza
The calculator assignment, originally
due Monday, November 15, is now due Thursday, November 18. I am also
tightening up the specifications a bit, as described on this
We do have lab this Friday (November 12).
Don't make the calculator assignment
harder than it has to be! All that I'm asking for is that it behave
much like a cheap dime-store calculator, doing one operation
at a time.
You do not need to worry about precedence of operations:
2+3*5= should give 25, not 17.
The calculator should display Error
(or something like that) if you divide by zero.
Most calculators, when you enter something like 2/+*3,
just use the last operation (*) rather than give an error.
JUnit is not designed for testing GUIs, and you aren't
required to use it.
and MSE (Masters) Pizza Bash
6:15 pm on Thursday Nov. 11 in Levine 307
I've posted a fairly long (but very dense) page containing
everything you will ever need to know about Object-Oriented
Concepts. Some tiny fraction of this will be on the midterm exam.
First correction (sigh!)...I said that all
your public methods should be made available on the calculator. Let
me amend that--all your public methods that result in a number
should be made available on your calculator. You do not need to have
keys for methods like lessThan, greaterThan,
and approximatelyEquals. Likewise, you will probably
use toString when you display your results, but it doesn't
make sense as a calculator key.
Over the weekend I plan to post more Swing examples, and probably
a bit more about the midterm.
The midterm will cover everything we have talked about so far except
Swing. Swing will not be on the midterm exam.
We have a tutor
for CIT591, CIT592, and CIT593. His name is Leland Weeks,
. To get things started, he will be available in Weiss Tech House
at the following times:
Mondays: 4:30 PM - 6:00 PM
Wednesdays: 10:00 AM - 12:00 PM
Fridays: 1:00 PM - 3:00 PM
Leland is willing to meet with you at other (mutually convenient)
times. This is a free service (as in, the Department pays
for his time), so don't be shy! Let's make it worth his while!
I've posted a program that should help you to write Swing GUIs
This will unzip into two files, SwingExamples.jar and
SwingExamples.java. You must keep these files together
in the same directory. If your Java is installed correctly,
you can run the program by double-clicking on SwingExamples.jar.
If it isn't, you can change the file name to SwingExamples.zip,
unzip it (there are a lot of classes there), make sure the SwingExamples.java
file is in the same directory as the class files, and run it from
Yes, you are supposed to test for Exceptions. If you haven't figured
it out yet,
It is clear that many of you never looked at this. For the current
assignment we are going to get serious about style, so I
strongly advise you to read it before you submit your programs.
If people show up, we can try some more code walkthroughs
this week. Come and bring your least favorite program! Levine 307,
at 2:00 Friday.
The current assignment (Fractions and Complex Numbers)
will be due Thursday, November 4, before midnight.
The lab this Friday will almost certainly be about Eclipse.
I've posted a complete example of a simple class with
JUnit testing, as JUnitExample.zip.
Changes to the Complex class:
Change public Complex abs() to public
double abs(). The absolute value of a complex number
is always a real number, so it's silly to return a complex number
with a zero imaginary part.
Add the method public double distance(Complex c).
You need this method anyway (for writing approximatelyEquals,
and I somehow forgot to list it.
Define approximatelyEquals for complex numbers
to mean that the distance between them is less than 0.001.
This is simpler to implement than the original statement, but
more importantly, allows you to use the JUnit method assertEquals(expected,
actual, 0.001), where expected and
actual are doubles.
These changes should be reflected in the JUnit tests.
Complex numbers: I've added a missing sqrt(...)
to the absolute value operation; and I've replaced the formula for
complex division with a simpler (though longer) version.
Remember, we will do some code walkthroughs today
at 2:00 in Moore 216. Everyone is encouraged (not required) to
attend, and I still need some willing victims volunteers to
present their code.
Midterm exam date moved to November 8, since November
3 is right after the election. If you're registered, vote!
Is it really all that hard to put "591"
in your Subject: line? See the note above, which has been there all
No office hours today. Sorry.
Hints on the Mad Libs assignment:
Read the documentation for the LineReader
Read the documentation for java.util.ArrayList.
Read the documentation for java.lang.String.
We have an acronym in computer science: RTFM, which stands
for Read The Fine Manual--or something
like that, anyway.
I have modified the Jigsaw
Puzzle assignment to be much more specific about what to print
We now have a CIT 591 discussion group set up on Blackboard.
You can use this to discuss assignments, problems, etc. with other
students. (I'll look at it occasionally, but probably not very often.)
Since we have a class rule against copying code, please do not
post completed or partially completed assignments there--at least,
not until well after their due date.
Jigsaw Assignment clarification: The print()
method in Puzzle only prints the piece numbers, nottheir edges. So when you print out a puzzle, it will look something
1 2 3 4
5 6 7 8
9 10 --- ---
(This is a printout of an incomplete puzzle--the last two pieces are
Grading policy reminder: The late penalty is
only 5 points per day (out of 100). It is much better to turn
in a working program a day or two late than to turn in a nonworking
program. You can turn in programs up to a week late.
In the assignment:
"Too close" means that the number of moves required to
reach the destination is less than half the number of rows AND is
less than half the number of columns. Translation:
If the trafficGrid has nRows rows and
and it will take distance moves for a car to reach
then the destination is too close if: (distance < nRows / 2) &&
(distance < nColumns / 2)
Another correction (sigh): rand.nextInt(n) gives a
number in the range 0..n-1, not 0..n.
And a comment:
To get p percent of n,
use (p * n) / 100.
Yet another correction: (20 * number of acres you have * amount of grain
you have in storage) / (100 * population) + 1
should be (20 * number of acres you have + amount of grain
you have in storage) / (100 * population) + 1
Minor corrections to assignment:
Clarified (I hope!) that the first summary is printed before
you begin your rule
You start with 100 people (not 50)
The formula for making something happen p percent
of the time has been corrected
I specified the order in which computations should be done
I'm also asking for a final summary (the state of the city at
the time you leave office)
There is a talk by Craig Nevill-Manning, of Google
on Tuesday, September 28, 3:00 - 4:30, inWu & Chen Auditorium.
The title is "Finding needles in a 20 TB haystack, 200 million
times per day."
This should be a good talk; I recommend it and I plan to attend
myself. I will not have office hours during that time, so I will
attempt to be more available the rest of the day.
Important red tape: Would everyone please check
the Sept. 17 Lab Partners
list and email me about any changes? Also, please check to make sure
you are listed on Blackboard
(especially people auditing), and email me if you are not. It would
help me to get this information as soon as possible! Thanks.
The help session will be held in Levine 307 this week
(Friday 2-3) and possibly next week, until we find a permanent classroom.
Pat Palmer will be offering UNIX command and editor workshops in
Moore 207, 4:30-6 pm on TR, this week only, for her CIT 593 students.
Students not in her class are also welcome, but will need to sit
in back of room or, should there not be enough terminals, look over
I recommend attending one of these workshops. GUIs are nice,
but sooner or later you will need to learn some basic UNIX, and
it's easier if you don't have to pick it up on your own.
I will not have office hours Tuesday, September 14.
You should have a gradient login. If you do not, request
, and indicate
whether you are an MCIT student, or in another program but enrolled
in CIT 591. If you cannot get a login in time, come to lab anyway.
There is no help session this week. Next week it will probably
be Friday 2-3, room to be determined.
There will only be one lab, 3:00-4:30 Fridays in Moore 207.
I haven't yet decided when the beginner's section will be.
The average quiz score was 15.6%.
CIS Dept. New Graduate Student Orientation
Tuesday, September 7, 4:00 PM
Wu and Chen auditorium
MCIT Pizza Bash on Thursday, September 9, 6:15 PM
(MCIT majors only, please) Free pizza and soda, and a chance to chat
with fellow MCIT students!