2017Dec.pdf - THE UNIVERSITY OF HONG KONG FACULTY OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE COMP3322 Modern Technologies on World Wide Web Date Time

2017Dec.pdf - THE UNIVERSITY OF HONG KONG FACULTY OF...

This preview shows page 1 - 4 out of 20 pages.

THE UNIVERSITY OF HONG KONG FACULTY OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE COMP3322 Modern Technologies on World Wide Web Date: December 19, 2017 Time: 9:30 pm - 12:30 pm University Number: Only approved calculators as announced by the Examinations Secretary can be used in this examination. It is the candidates' responsibility to ensure that their calculator operates satisfactorily, and candidates must record the name and type of the calculator used on the front page of the examination script. Candidates are allowed to bring into the examination hardcopies of all lecture slides, on which handwritten notes are allowed. Answer ALL questions in the space provided. Use the reverse side of a page if you need extra space. Write your university number at the top of each page. Total mark is 100. Question Score 1 (14%) 2 (22%) 3 (24%) 4 (32%) 5 (8%) Total (100%) Page 1 of20
Image of page 1
Quest ion I (14%) Answ er t he followin g question s. (1) (4%) Give four exampl es of application-layer protocols. (2) (2%) How many IP addresses do we need when bu ilding the fo llowing n et work? ., • . Host "~T'" ' ..... . · tf. . ~ ,. ·/ ' ,, Hos t. ~ .7 "- ·· . - -- ·-· - ··--····· ----·-- · \a - -·- ·-- ·· -- -- H os t ~··::- ' Router (3) (8%) Suppose the web browsers on two hosts A and Bare configured such that all HTTsent from the web browsers go to the proxy server (web cache) C first. Suppose the web cacinitially empty. Then during a 5-minute interval, the browser on Host A successfully loaded the webpage http:ljwww.cs.hku.hk/index.html (webpage 1), and then t he browser on Host B successfully loaded the webpage htte..:.fj_www.c~jlk~~MQ.!:[email protected]/mphil-p_b_gjacJmjg;ioQJ.~J(webpage 2). Suppose webpage 1 references three images: http://www.cs.hku.hk/ logo1.jpg, h!!P~ww.cs._h~_l.'J:t~LJggQ.~.'.jp_g and http://w~~,f~_,hku.hk/logo3_Jp_g, and webpage 2 referentwo images http://and http://logo4.jpa. During the 5-minute interval, how many HTTP requests in total were sent from the to the proxy server? b. How many HTTP requests in total were sent to the web server ? c. How many HTTP responses were sent from the proxy server to P requests he was ?. ces g. two browsers host A? Page 2 of20
Image of page 2
d. How many HTTP responses were sent from the proxy server to host Question 2 (22%} Suppose you are implementing a simple web page using HTMLS canvas. (1) (3%) Add a canvas element in the division element in index.html as follows, with id "myCanvas", width of 300px and height of 300px. <!DOCTYPE html> <html> <head> index.html <link rel=stylesheet href="style.css" type="text/css"> </head> <body> <hl>Olympic Rings</hl> <div> </div> <script src="script.js"> </script> </body> </html> (2) (15%) Implement the JavaScript code in script.js, to draw five rings at the center of the when the mouse pointer is moved over the canvas, as illustrated in the following figure. The of the rings are at (106, 140), (150, 140), (194, 140), (128, 160) and (172, 160), respectively. The radius of the rings is 20. You should register event handler with the mouseover event using the addEventlistener() method. Use basic JavaScript. B? canvas centers
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 20 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture