Par T A - Multiple Choice Questions: Total 10 Mar Ks

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

Par t A - Multiple Choice Questions: Total 10 Mar ks

Circle the most appropriate option for each question.

Question 1 (2 mar ks):


Which of the following CSS properties and values can be used to hide an element?

a) hide: true
b) display: none
c) z-index: -1
d) visibility: off

Question 2 (2 mar ks):


Which of the following javascript statements can be used to change the width of an element
with the ID 'mydiv' to 40%?

a) document.getElementById('mydiv').width = '40%';
b) document.getElementById('mydiv').style.width('40%');
c) document.getElementById('mydiv').style.width = ' 40%';
d) document.getElementById('mydiv').style.width = 40%;

Question 3 (2 mar ks):


Which of the following Javascript statements correctly displays the last element of an array
called 'products'?

a) console.log(products.get());
b) console.log(products[-1]);
c) console.log(products[products.length - 1]);
d) console.log(products[products.length]);

1 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

Question 4 (2 mar ks):


Which of the following CSS selectors will match all img tags inside an element with a class
'shopping-cart'?

a) img #shopping-cart
b) .shopping-cart,img
c) .shopping-cart img
d) .shopping-cart #img

Question 5 (2 mar ks):


Which tag do you use to embed a CSS stylesheet in an HTML document?

a) style
b) link
c) a
d) href

END OF PART A

2 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

Par t B - Technical Skills: Total 20 Mar ks

Write your answer in the space below each question.

Question 1 (5 mar ks):


Write the HTML5 code required to create a form that looks like the following screen design.
Only write the FORM element and its contents (you do not need to include an entire web
page, and you do not need to include any javascript in your solution).

• For the email field, make sure that the user can only enter a valid email address.
• The user can only select one day (either Friday, Saturday, or Sunday)
• The form elements are grouped together with the caption 'Options'

3 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

Question 2 (5 mar ks):


Complete the missing javascript code to make change the background color of a text field to
yellow when the user clicks on the text field.

Here is the partially completed code (some code has been omitted as indicated by the ellipses
"…"). The space marked with the arrow is where the missing javascript belongs. Write the
missing javascript on the next page.

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title> </title>
<script>
...
</script>
<style></style>
</head>
<body>
<input type="text" id="myfield" onclick="highlight()"/>
</body>

</html>

Write your Javascript on the next page.

4 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

5 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

Question 3 (5 mar ks):


Write down the CSS style definition required to style the body so that it has:

a) a correct CSS selector


b) a 2em padding on all sides
c) a width of 80%
d) a font family set to Arial
e) a background image set to the file "sky.png"

6 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

Question 4 (5 mar ks):


Complete the missing javascript code in order to count how many elements are in a javascript
array representing a shopping cart (some code has been omitted as indicated by the ellipses
"…").

• Create the function checkIfOnline() so that when the user clicks on the button,
the player’s name input by the user is read from the text field. Loop through the array,
and if the player is in the array then alert the message "The player is online".
Otherwise if the player is not in the array, alert the message "The player is
offline".

Here is the partially completed web page.

...
<script>
var playersOnline = new Array();
playersOnline.push("Rob");
playersOnline.push("Ali");
playersOnline.push("Sue");
playersOnline.push("Shaz");
playersOnline.push("Matt");
playersOnline.push("Aaron");

</script>
...

<input type="text" id="player" />


<button onclick="checkIfOnline()">Check</button>

...

Write your Javascript on the next page.

7 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

END OF PART B

8 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

Par t C - Shor t Answer Questions: Total 10 Mar ks

Write your answer in the space below each question.


Question 1 (2 mar ks):
Describe what a server side and client side language is. Provide one example of each.

Question 2 (2 mar ks):


What is the function of a Web Server and an FTP Server?

9 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

Question 3 (2 mar ks):


Describe two (2) ways in which you can specify CSS style information for a document.

Question 4 (2 mar ks):


What is the function of a Domain Name System (DNS) server?

10 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

Question 5 (2 mar ks):


Describe two (2) ways to optimise how your site is indexed by a search engine.

END OF PART C

11 of 12
1621ICT - Web Design & Development Deferred Final Examination, Semester 3, 2016

END OF EXAMINATION

12 of 12

You might also like