CS 20, Summer 2009
Project 1
Due: Tuesday, June 30, 9:00pm
Worth: 100 homework points
Before you begin:
|
- If you do not already have a College of Engineering user account, then sign up
here
now. Be aware that your account will not be ready to use immediately, as
setup requires human processing during working hours. When it is ready,
verify you can access it, and change your password as instructed!
- Verify that you can log in to your account remotely using a secure shell program
(like PuTTy). You may also use the CSIL
lab (HFH 1138) itself.
- Complete this
Student Information Form, and submit it
just one time before turning in any projects.
|
Copies of all necessary files are in ~cs20/p1/
(actually subdirectories
part1
, part2
and part3
) on CSIL:
- Original versions of Date.java and DaysBetween.java for part 1.
- FigureGeometry.java, Circle.java and FigureTester.java for part 2.
- SquareMatrix.java and MatrixTester.java for part 3.
All parts are derived from specific Exercises at the ends of
Chapters 1 and 2 in the required text. Read them, but to the extent
instructions here differ from those in the text, the instructions on these web pages take
precedence.
- Revise the text's classes called Date.java
and DaysBetween.java as specified in
Chapter 1 Exercise 24 on page 55.
- Begin with the copies of these classes in
~cs20/p1/part1/
, and heed the
instructions in those files. Precisely meet the specifications laid out in the text.
- For these files and every Java source code file you turn in from now on, add comment lines
at the beginning that include your name and the date the program is written.
- Part 24a requires changing just DaysBetween.java, but 24b requires changes
to both classes.
- Exactly match the error messages shown in the text: "Illegal input was entered" and
"That is not a valid date" so that we may automate our testing of your solutions.
- Of course, you should thoroughly test your own solution too. Notice that "valid" dates
begin on October 14, 1582, so any earlier date is not valid. Any month number less than 1 or
greater than 12 is invalid. Any day number less than 1 or greater than the number of days
in the corresponding month is invalid, and February 29 is only valid in leap years. Look
up the (not-so-simple) definition of a leap year on page 15.
- Write Rectangle.java
as specified in Chapter 2 Exercise 10 on page 145.
- This class must implement the FigureGeometry interface - see page 67 and contents of
~cs20/p1/part2/FigureGeometry.java
.
- The
~cs20/p1/part2/
directory also contains Circle.java
from page 68,
and FigureTester.java
to test your work. Here is a sample
FigureTester run from our solution.
- Do part b of Chapter 2 Exercise 11 on page 146, and modified as follows:
- Study the interface, SquareMatrix.java, in
~cs20/p1/part3/
.
- Write ArraySquareMatrix.java to implement
the interface using a two-dimensional array of
double
values (not integers as
specified in the text).
- Use MatrixTester.java
in
~cs20/p1/part3/
to test your implementation. Notice that consistent results may be achieved
by entering a seed value at the command line. If run with a seed of 92, for example, the
results should exactly match these seed 92 results
from our solution. When the application is run without a seed, the application should produce
random results.
- Complete the Student Information Form if you have not
already done so.
Then turn in the four required files at once
from your engineering account as follows:
turnin p1@cs20 Date.java DaysBetween.java Rectangle.java ArraySquareMatrix.java
Late projects may not be accepted.
Updated 6/20/09 by C. Michael Costanzo