Computer Science 15-110, Lecture 9 (Sections M-Q), Fall 2009
Lab 1
Due: Mon 31-Aug-2009 at 11:59pm (email copy to your CA)
(no late submissions accepted).
Read these instructions first!
- The homework collaboration policy does not apply to labs.
On homeworks, you must work alone. On labs, however, while you may
work alone, you are strongly encouraged to work in groups (collaboratively).
Groups would typically range from two to four members, but this is just a
suggestion. It is expected that everyone will work on lab in groups
except for special circumstances which should be pre-arranged with the
course instructor.
- That said, you may not simply copy your answers
in whole or in part from others in the group. You must put in bona
fide effort on every assigned problem and be a real contributor to the
group. Then, yes, you may have the same or overtly similar answers as
others in the group. But this must be the result of working together,
and not simply copying someone else's work. Also, even with similar
answers, everyone must submit their own solutions independently.
- Labs are graded, and the grade is included as
part of the corresponding homework. For example, lab1 will be graded
as part of homework1.
- Lab time will generally be provided during
recitation. However, recitation lasts 50 minutes, and includes other
details (homework Q&A, etc), and labs may require several hours, so you
should expect to continue working on the labs outside of recitation.
- Regarding labs in recitation, the participation policy is in effect -- you
are expected
not only to attend recitations, but actually work in a group on the labs. If you have
completed the assigned work, then you should either help others, if they
request it, or you should delve deeper into the assigned material.
But you must use the lab time exclusively to explore the material covered in
that lab.
- In particular, you may not use lab time to do
your homework (for this or any other class), as that defeats the
collaborative nature of the lab.
Then read these additional instructions!
- Getting started:
- Download
To start, copy this file to your hard drive:
Lab1.java
- Rename
Rename the file to include your andrew id by appending it to "Lab1".
For example, my andrew id is "koz", so I would rename the file to
Lab1koz.java (of course, you should use your andrew id in place
of mine).
- Edit
Next, run DrJava or JCreator and load the file you just renamed.
Hint: If you are on a Linux machine in 5419, don't forget this
hint: In DrJava's edit menu, open the preferences dialog.
Paste the following path into the "Tools.jar Location" field:
/usr/lib/jvm/java-1.6.0-sun-1.6.0.15.x86_64/lib/tools.jar
Apply the change, and close DrJava. When you re-open DrJava, it should
successfully find the compiler and work correctly. Each user should only
need to follow this procedure once ever.
- Sign
Next, be sure to include your name, andrew id, and section in a comment
on the first line of the file!
- Solve
And finally, edit/compile/run that file until it passes all the tests
(well, that's the goal, at least)
.
- Programming guidelines:
- Try to use well-named variables, proper
indenting, reasonable commenting, etc.
- Note: You may not use Java concepts we have
not yet covered, including loops (do/while/for), conditionals ("if"
statements or ternary operators (?:)), arrays, or methods from any
classes in java.util.* (besides Scanner or others we explicitly use) to
solve these problems (which isn't a problem for most of you, seeing as
we have not yet covered these!). While they may be helpful, every
problem here is solvable without them, and they are not permitted for
now.
- What to submit
- Just submit your completed Lab1andrewId.java
file. Do not submit your .class file or any other files.
Just the .java file.
- How to submit
- Send an email with your Lab1andrewId.java
file as an attachment to your CA by the submission deadline. Do not
miss the deadline, even by one minute! Email problems are not a
valid excuse for late submissions.
- You should "cc" yourself in that email, too,
just to confirm that you properly sent the email.
- Note:
- Improper submissions will be penalized up
to 10 points and may be rejected.
- Late submissions will be rejected.
Carpe diem!