ASSIGNMENT NUMBER 1 REPORT 1.PROBLEM DESCRIPTION * Local Times * Local times of four different cities are to be displayed on the screen concurrently * Each local time should have the format: hours:minutes:seconds * Each local time should be updated secondly Example: Ýzmir 19.26.01 19.26.02 19.26.03 Taipei 25.26.01 25.26.02 25.26.03 Buenos Aires 14.26.01 14.26.02 14.26.03 Stockholm 18.26.01 18.26.02 18.26.03 2. SOLUTION IDEA One program (java applet), which takes name of the city and time zone as inputs, is written. The HTML Page will call four instances of this program. In the program the system date will be read once in one tenth of a second and the screen will be updated if necessary. 3. PROBLEM SOLUTION In HTML page four instances of java applet must be started. All programmes (4) will run as independent processes in a single HTML page. The java applet has different methods. These methos are explained in the following paragraphs. In the initialization part of the program inputs parameters are read from the HTML page. Paint is the main part of the program. It first read the system clock. If the clock is changed the new time has to be displayed. To display hour, minute, and seconds are parsed from time. The hour of the corresponding time zone is calculated. Then the string that will be displayed is constructed by concatenating hour, minute, and seconds fields of the time. The name of the city is displayed at the top of the screen. The time is at the bottom. Before displaying the current time the old time has to be erased. To do that the last displayed time is written again with the background color. The start method starts a timer. After an applet is initialized it is started. It starts up a thread to control the applet. Stopping occurs when the reader leaves the page that contains a currently running applet. Here the stop method stops the timer. Run method makes the applet to wait for 100 milisecond and then repaint the screen if necessary. If one second is waited then we do not have synchronisation between the applets. So waiting for less time to read system date is better solution. Update method call the paint method.