Computer Science APEA 15-100, Summer 2009
Homework 1
Due: Tue 30-Jun-2009 at 8:59am (email copy and identical physical copy)
(no late submissions accepted).
Read these instructions first!
- Be sure to include your name, your Andrew ID, and your section clearly on the top of each file in your assignment.
- For non-programming problems:
- Place all your solutions to the non-programming problems in a single
file named Hw1 (with whatever extension is appropriate for the format you
choose, such as Hw1.txt or Hw1.html, etc). You must use one of these
file formats: plain text (txt), or RTF, or HTML, or Word (doc, not docx), or
PDF. No other file formats will be accepted.
- Show your work. Correct answers without supporting
calculations will not receive full credit.
For programming problems:
Place each solution in its own file named exactly as given below, and
with a class name that exactly matches the file name. So if the file name
is Hw1Foo.java, the main class in that file must be Hw1Foo.
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 tertiary 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
- Create a submission directory like this: "koz-hw1" (replace
"koz" with your andrew id)
- Place all the files you are submitting in that directory, zip that
directory, and submit the zipped directory
- How to submit
- Send an email with the zipped submission directory 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.
- It is recommended
that you "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.
- Convert 10110 from two's complement to decimal. Remember:
show your work on all of these problems!
- What are the largest and smallest possible numbers in 6-bit two's
complement?
- Explain why -1 has the representation it has in two's complement.
- Explain why the Hash<31,4> code for "abcd" is 7074.
- Find your own andrew id's hash code.
- How long will it take to transfer all of the contents of the library of
congress over 56 kilobits/sec? You may round your answer.
- Say it takes one year to run a simulation of a nuclear explosion on your
smartphone. About how many years will it take until the same simulation
requires only one minute on a new model of the smartphone?
Carpe diem!