CSE143

Autumn 2002

Homework 0

Happy Anniversary, Anyone?

Problem: determine if any interesting anniversaries will occur during this Autumn quarter

Electronic deadline: Tuesday, October 8, 2002, 9:00 p.m.

Think about your ideal system for solving the problem above.  It doesn't have to depend on computer knowledge you currently have.  But it should be at least plausible, based on knowledge you do have and common sense.  For example, if you think that a computer-controlled can opener would be part of your solution, you can include it, even though you might have no idea (currently) how to program such a gadget.

Part A: Write a Requirements Description for your system.  It should be no more than one printed page in length, and may be much shorter.  The description should be in English, with no diagrams or code.

Part B: Write a high-level Design Description for your system.  It should occupy no more than one printed page.  You may use English prose or diagrams or a mixture of the two, as appropriate.  But no code!

Grading notes for A & B: There is no single "right" answer.  Grading will consider how clear, relevant, and plausible your descriptions are.  Be especially careful not to mix requirements and design.

Part C: In this part, you will write and test a short Java program.  The program prompts a user to enter their birthday as month (1-12), day (1-31) and year (a four-digit integer), in that order.  Then it prints back out the person's age -- in days!  Finally, the program states whether the age (in days) is "interesting", where interesting is defined as "a multiple of 1,000 (decimal)."  It only has to work for people who are alive today (not for Julius Caesar or Genghis Khan).   (Note that what this program does, and what it deems "interesting", may be totally different from what you present in A and B.)

The Java code you write should not need any features you didn't learn in CSE142.  One exception: you should have a standard "main" method in this program (see Chapter 5).  When a user (such as a TA grading your program) wants to start it, all they should need to do is run that method, and everything works from there.  To further specify this: you must name your main class Birthday (file name Birthday.java).  That simplifies our testing.

Notes on grading for Part C: Keep it simple!  But make it good.  Use your very best style.  We are mainly interested in seeing

that you can write a program which communicates well to a human reader

that you can read a problem description and turn it into working Java code

that you can use the tools for creating and testing a Java program

that you can use our tools for turning in programs 

that you can follow our instructions! so read carefully.

You'll be asked at some point to report on how well your program operates, that is, whether it always gets the right answer.

To repeat: keep it simple!!  A lot of questions that you might have about Part C can be answered by referring back to this motto.

You may work with a partner on all parts of the assignment.  Detailed instructions for how to turn in your work will be available eventually.

The "interesting anniversaries" theme will continue in the next homework, by the way.

Click here to submit Part C of the project.