CMSC 122

"Watch Time Go By" Option


Your program will produce an HTML page that simulates a digital clock going through and displaying every single second in a day! We suggest using some nested loops to get this to work. If you have done it correctly, then the output will consist of at total of 86,400 paragraphs (since there are 86,400 seconds in a day). The beginning of the output will look like the screenshot below:

time1

Here is a screenshot showing the very end of the output:

time3

Note that we are padding the minutes and seconds with leading 0's. I.e., it should look like "12:00:07AM" and not "12:0:7AM". It is up to you whether or not to pad the hours with a 0. In other words, either "1:24:59AM" or "01:24:59AM" is fine.

The output should follow the usual pattern for time: After the output for the 12AM hour (3600 paragraphs) we should see output for 1AM, then 2AM, etc. Eventually, your output should reach noon. Be sure to transition from AM to PM at the right spot. Below is a screenshot of this section:

time2

Hints

Web Accessibility