Com S 100J Introduction to Computer Programming Grade: letter or S/U Fall 2003
4 credits Newsgroup: cornell.class.cs100j Instructor: David Gries

Notes on assignment A1
Home
About email
Academic Excellence Workshop
Academic integrity
Announcements
DrJava
Exams & grades
FAQs
Handouts, general
    Assignments
    Labs
    Quizzes
Links
Staff info
Syllabus
Texts
Times & places
 
Email Gries

 

1. The due date in now 18 September instead of 16 September.

2. About DateFrame.

Class Date is in package java.util. Please look at the specification of its function getYear. Part of the assignment asks you to set this window's height to 120 + (d's year modulo 300). When you do this, use the value that function getYear gives you. Do NOT change it in any way.

3. About method getPartner of class FramingFrame

The original handout that was on the website had some wording that was confusing some students, and it has been changed. Your class FramingFrame will have a field partnerFrame (you can choose whatever name you want) that contains the name of the manilla folder for the partner frame, the one that surrounds the original one. Method getPartner simply returns that variable:

return partnerFrame;

The presence of this function allows the user to access the partner frame, to look at its width, height, origin, etc. So, we can do something like this:

FramingFrame ff= new FramingFrame();
ff.createPartner();
JFrame partner= ff.getPartner();
int width= ff.getWidth(); // ff contains the width of the partner frame

For the fifth task, wrigin class CrossFrame, methods getTop, getBottom, getLeft, and getRight are there for the same purpose; each of these should return the name of the manilla folder for that partner.

4. Position and width of partner frames
It is important that you create each partner frame with the position and size that is given in the handout. In order to help grade your assignment, we write a program that creates instances of your classes, calls their methods, and check the values returned by your functions. For example, if the width of one of your partners should be 10 and you made it 11, then it is wrong.

It is not difficult to get the size and position of the partner frames right. Just follow the specifications of the methods carefully. For the four partner frames for class CrossFrame, we gave the position of only one of them, thinking you could figure out the others. In order to remove any doubt, here is where these partner frames should be placed, assuming that the size of the main frame is (W, H) and the size of the partner frames is (w,h):

top (or north) frame: h+1 pixels above and w/2 pixels to the right of the top-left corner of this frame.
left (or west) frame: h/2 pixels below and w+1 pixels to the left of the top-left corner of this frame.
bottom (or south) frame: H+1 pixels belowand w/2 pixels to the right of the top-left corner of this frame.
right (or east) frame: h/2 pixels below and W+1 pixels to the right of the top-left corner of this frame.