Question 9

OCR Computer Science June 2017 Paper 1A level11 marks

On the specification

(a)
1.3 Exchanging data
(b)
1.3 Exchanging data
(c)(i)
1.3 Exchanging data
(c)(ii)
2.2 Problem solving and programming1.3 Exchanging data
(c)(iii)
1.3 Exchanging data
Question text

9 A website contains the following HTML: <html> <head> <title>Boris' Cake Shop</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <h1>Boris' Cake Shop</h1> <p id="intro"> Welcome to Boris' cake shop. <script> var hour = new Date().getHours();//gets the hour value of the current time if(hour>9 && hour<17) { document.write("We are currently open."); } else { document.write("We are closed, come visit us when we are open (09:00 - 17:00)."); } </script> </p> <div class="customerQuote"> Boris makes the best cupcakes I have ever tasted. </div> </body> </html> (a) Explain the difference between a HTML id attribute and a HTML class attribute. [2] (b) The html file is linked to the CSS file style.css Text between h1 tags should be in the font Arial. The customer quote should be on a background with the colour E8C3E1. The introduction text should be dark red (using the named colour darkRed). Write the code that should go in style.css to give this formatting. [6] (c) The code between the script tags is supposed to display a different message during the shop’s opening hours of 09:00 and 17:00. (i) State the name of the language used between the script tags. [1] Some users have reported that there is a bug and the site says the shop is closed when they log on between 9 and 10 in the morning. (ii) Explain how this bug can be fixed. [1] (iii) Give one disadvantage of this code being run client side rather than server side. [1]