Computer Science 120
Introduction to Programming
Fall 2011, Siena College
Homework 2: The Digital Clock
Due Date: Friday October 7th, 2011 11:59 PM
Create the Digital Clock program shown below:
Program requirements:
- The clock should be composed of four clock digits which could be used to show the time.
- The clock's time should change by an hour or by a minute by clicking on the appropriate text. If the minute addition forces the minutes back to 00, the hour should be incremented by one.
- Each digit is composed of seven bars (3 horizontal and 4 vertical). A separate class must be used to handle the displaying of a single digit. This class must be able to display any digit between 0 and 9, and it must handle the changing of its digit representation.
- The clock should always start at 12:00 AM time. This is a simulation: you should not be trying to initialize it to the exact local system time.
- The add hour and add minute methods should alter the AM/PM valuas as necessary.
- EXTRA CREDIT (up to 10 points) You may implement the AM/PM or Military time switch, which toggles between military time (with leading zeroes for hours 00-23 to AM/PM time (1-12, no leading zeroes).