CSSE 220: Object Oriented Software Development
Exam 2, Spring 2008-2009

The Problems

  1. Read the rules for this exam.
  2.  

  3. Implement and test a new project called Exam2 that implements this UML class diagram, Stage 1.

    Grading rubric — 10 points, as follows: 5 points if the tool tips work, 5 points if everything else works. But no points if you do not follow the UML class diagram, Stage 1.

  4.  

  5. Implement and test the addition of a single LightGrayButton to the CyanPanel as described in this UML class diagram, Stage 2.

    Grading rubric — 15 points, as follows: 3 points if the button appears as specified, 12 points if it acts as specified. But no points if you do not follow the UML class diagram, Stage 2.

  6.  

  7. Revise your project so that:

    1. Instead of a single LightGrayButton, the CyanPanel displays 100 LightGrayButton's (each of which acts just like the LightGrayButton described in the previous problem).
    2. Furthermore, clicking the mouse anywhere in the CyanPanel (except on a button) should reset the text to "1" for ALL the buttons on the CyanPanel.

    Grading rubric — 25 points, as follows: 10 points if clicking the mouse resets at least one of the buttons to "1", 15 more points if clicking the mouse resets ALL of the buttons on the CyanPanel to "1".

  8.  

  9. Implement and test the following (partial credit is available):

    1. A WhiteButton class as described in this UML class diagram, Stage 4.
    2. Add a new LightGrayButton to the YellowPanel.
    3. Add a new WhiteButton to the CyanPanel.
    4. The WhiteButton in the CyanPanel has-a the sole LightGrayButton in the YellowPanel.
    5. Pressing the WhiteButton in the CyanPanel does ALL of the following:
      • It increments its own number.
      • It changes the background color of the CyanPanel to PINK. (Don't bother to change the Tool Tip.)
      • It changes the background color of the YellowPanel to BLUE. (Don't bother to change the Tool Tip.)
      • It increments the number on the sole LightGrayButton in the YellowPanel.
    6. A WhiteButton should be WHITE.

    Here is what your project should look like after completing this problem (after the user presses the WhiteButton and various LightGrayButtons, including the one on the YellowPanel).

    The new part of the UML for this stage is shown in gray in that diagram.

  10. Grading rubric — 30 points, as follows:

     

  11. Implement and test the addition of a single JButton to the YellowPanel, where the JButton responds to itself via an anonymous class by decrementing its number.

    Here is what your project should look like after completing this problem (after the user presses the orange JButton several times).

    Grading rubric — 10 points, as follows: 10 points if the button responds to itself successfully via an anonymous class, else no credit.

  12.  

  13. Implement and test the addition of a single PinkButton to the YellowPanel as described in this UML class diagram, Stage 6.

    Grading rubric — 10 points if the PinkButton behaves as specified.

  14.  

  15. Turn in your work by committing your Exam2 project to your individual repository: