CISC 181 Introduction to Computer Science, Fall, 1998

Programming Project - A Clock Applet.

We are separating this week's programming goals from last weeks. Thus you may implement the "Clock Applet New Basic Specification" below. It is also fine to implement the original spec.

Submit a printout of your code ( .java file(s) ), and of your applet. To obtain a printout of your applet, load it into a browser such as Netscape and use it's print command, for example from its file menu. when the print menu comes up put qpr -q smicol . This will cause the page to be printed in color. You can pick up the output in basement of Smith. Color printing is 25 cents per page. We print this week to see how our color applets look on paper. This will be illustrated in class Monday. (Printing the applet on personal color printer is also ok.) Color

The project is due Monday. About timeliness: It is important for the progress of the learning process and for the sanity of the instructors that project are completed in a timely way. However we propose to keep some flexibility with a system of rather modest penalties for lateness. This exercise is due Monday, Oct 12. Printouts dated Monday and handed in within 24 hours are considered on time. Submission 1 to 3 days late (Tue,Wed,Thu) is subject to a 10% penalty. Submission 4 to 7 days late (FSSM) is subject to a 30% penalty. Exercises are not accepted over a week last.

Clock Applet New Basic Specifications

Write a Clock applet whose paint method draws a clock with hour, minute, and second hands. You may draw the hands in fixed positions of your choice. For testing purposes the applet should exploit an integer parameter "SPEED" in the applet tag. The clock should then display the value of the speed parameter somewhere on the applet using the drawString method. See 181/java-examples/XOR/ for an illustration of parameter use. The Basic specification also calls for a multicolored design for the cabinet and clock face and clock hands. This is to exercise the use of drawPolygon and/or fillPolygon, and the use of custom colors. To meet this specification you must
  1. Use at least 10 colors in your design, of which at least 5 are custom specified from R,G,B values.
  2. Create clock hands which are more than just line segments. Each hand can be a polygon or a combination of polygons and ovals, for example.
  3. Design a colorful clock face and "cabinet". In otherwords, make the background for your animated hands be something colorful and at least moderately complex geometrically.

Clock Applet Old Basic Specifications

Write a Clock applet whose paint method draws a clock with animated hands. The clock should have three properly working hands, showing hour, minute, second. The hands should advance at the proper interval. For testing purposes the applet should exploit an integer parameter "SPEED" in the applet tag. The clock should then run at a rate that moves the second hand SPEED seconds per actual second. The Basic specification also calls for a multicolored design for the cabinet and clock face and clock hands. This is to exercise the use of drawPolygon and/or fillPolygon, and the use of custom colors. To meet this specification you must
  1. Use at least 10 colors in your design, of which at least 5 are custom specified from R,G,B values.
  2. Create clock hands which are more than just line segments. Each hand can be a polygon or a combination of polygons and ovals, for example.
  3. Design a colorful clock face and "cabinet". In otherwords, make the background for your animated hands be something colorful and at least moderately complex geometrically.