CIS 180: Object-Oriented Programming
Homework #8

Leap Year

Due November 21, 2011


The objectives of this homework are:

Problem Statement

For this project you are asked to design and implement a simple application that allows the user to enter a 4-digit year, and reports whether or not the year is a leap year.

A year is a leap year if it is evenly divisible by 4 but not evenly divisible by 100 unless it is also evenly divisible by 400. So 1996 was a leap year. But 1900 was not a leap year because, although it is divisible by 4, it is also divisible by 100 and not by 400. 2000 is a leap year because it is divisible by 400.

The application should contain a label prompting the user to enter a year, and a text field where they enter their input. When they type a year and press the enter key, the answer should be displayed as a label below the text field. The application should look like the following sample:


Draw a UML class diagram to design your application, showing all of the fields and methods, including their accessibility (public or private) and data types.


Code your application and test thoroughly, making sure you check all of the leap year rules.


What to turn in

When your assignment is complete, add some comments to the comment block of the java source code explaining any problems you encountered in completing the assignment and describing any bugs in your solution.

Submit your source code as well as your class diagram as email attachments to your lab instructor. Alternatively, you may submit your class diagram in hardcopy. Use the subject line CIS-180 HW#8 in your email.

Make sure you send your homework to the proper place. Homework sent to the wrong address may not receive credit!

Lab SectionGraderEmail
L1 Mon. 2PM Wes Fowlks
L2 Wed. 9AM Neelima Mothe
L3 Wed. 1PM Wes Fowlks

There will be a 10% penalty for assignments received after the due date. Assignments will not be accepted more than one week past the due date.