Computer Science APEA 15-100, Summer 2009
Homework 3
Due:  Thu 2-Jul-2009 at 8:59am (email copy only)
(no late submissions accepted).


Read these instructions first!


  1. Reading
    Finish reading Chapter 1 carefully for tomorrow's quiz, which covers all of Chapter 1.  This is an abridged assignment in order to provide enough time for you to carefully read the textbook.
     
  2. Fix the Extra-Pixel Problem
    Starting from the code you submitted for hw2, fix the flags of Benin and Azerbaijan (skipping Panama) so that they no longer suffer the extra-pixel problem.  Place the fixed flags in the files Hw3FlagOfBenin.java and Hw3FlagOfAzerbaijan.java, respectively.
     
  3. Sample Quiz Questions
    Write 5 sample quiz questions:  2 easy questions, 2 medium questions, and 1 hard question.  They should cover randomly-chosen topics from the many that may appear on tomorrow's quiz, taken from Chapter 1 reading and the course notes, labs, and other materials.  For reasons that will soon become clear, you should really try to randomize your topic choices.  In any case, they should be similar in spirit to the sorts of questions you have seen so far, but as different as possible from those questions (eg, if you simply change the numbers on an existing question, you will not get full credit).  Be creative, but do not obsess too long on this question (no more than 30 minutes).
     
  4. Group Study
    Form a study group of around 4 students (no more than 5 in any case, preferably no groups smaller than 3).  Don't be "clique-ish", as the next time you are in a study group you will have to pair up with all new partners anyhow.  As a group, work through each of your sample quiz questions, solving them collectively.  This activity should require at least 30 minutes.  For this problem, each of you should submit a list of the names of everyone in your group, when, where, and for how long you met.  (Don't forget to also submit your 5 sample questions, along with their solutions, from the previous problem!)

    To facilitate study group formation, it is highly recommended that you appear around 8pm either at the office hours or at the Morewood cluster or commons (note that office hours start at 7pm, but this leaves you an hour to read and to write your questions).  If this is impossible, please inform your instructor and your CA (and for a compelling enough reason, such as a conflicting evening class, you will be exempted from the group study portion of this assignment).
     
  5. Bonus/Optional:  Flag of Panama, Stars Included
    Draw the flag of Panama using Polygons for the stars.  To get you started, here is some sample code using a Polygon:
       
    Polygon p = new Polygon();
        p.addPoint(100, 50);
        p.addPoint(200, 125);
        p.addPoint(300, 50);
        page.setColor(Color.black);
        page.fillPolygon(p);
    This is really all you need for this task, but if you need more information, check out the Java API link from the course web site.

Carpe diem!