You are on page 1of 11

TUTORIAL QUESTIONS 2020

QUESTION 1

a. Using a diagram, describe the client/server architecture in relation to the Internet.


[10]

b. Design, using HTML, a form which captures personal details of a user for registration
into some system. The form should capture the user’s first name, surname, date of birth,
gender, number of pets, e-mail address and phone number. The user should be able to
choose their gender from a choice of two radio buttons. A list should be given for number
of pets ranging from 0 to 5+. The user should be able to submit the form or clear the
contents of the form elements.
P.S. Do not code the submit button [15]

QUESTION 2

a. Apply any five principles of good website design in a report to your clients who want you
to design a very colourful Tupperware sales website with many pictures.
[10]

b. Differentiate between using WordPress and an HTML for designing websites.


[8]

c. Contrast between IPv4 and IPv6 stating the advantages IPv6 has over IPv4.
[7]

QUESTION 3

a. Write brief notes on the importance of implementing security on the internet.


[15]

b. In PHP, what do the following date functions return? Use today’s date as example to
answer.
i. date("f") [2]
ii. date("l") [2]
iii. date("w") [2]
iv. date("h") [2]
v. date("y") [2]

QUESTION 4

Page 1 of 11
a. Compare and contrast the actions performed by the client and the server when a static vs.
a dynamic request is made. [15]

b. Discuss any five services provided by the internet. [10]

QUESTION 5

a. State any five graphic format files. [5]


b. Discuss the four design principles (proximity, alignment, repetition, contrast) to the
creation of web sites. [20]

QUESTION 6
a. You are working for a consultant company and a client approaches you requesting for
clarification on the difference between server-side and client-side scripting. Write brief notes to
help the client differentiate the two concepts using the different web programming languages as
examples. [15]
b. Write brief notes about the following internet related concepts:
i. IP addressing.
ii. Hosting.
iii. Domain Name Services.
iv. Service providers.
v. SQL injection. [10]
Total Marks [25]
QUESTION 7
a. Using code snippets show how XML, HTML and XHTML differ in the syntax and also
outline the strengths and weakness of each language. [12]
b. Outline the steps you would take to connect a user form to a MySQL database using
XHTML for client-side scripting and PHP for server-side scripting. [13]
Total Marks [25]
QUESTION 8
a. Using code snippets, illustrate how you can perform input validation on a user form to
ensure data consistency and integrity . [18]

Page 2 of 11
b. Write a CSS code that changes the background of a page by inserting the same
background image without repeating it on all pages in the Web site. [7]
Total Marks [25]
QUESTION 9
a. Outline any four selectors used in CSS and also explain how each can be used to style
web pages. [15]
c. Write the code for a basic XHTML structure. [5]
d. Write a Javascript code that alerts the user when a record has been successfully saved to
the database. [5]
Total Marks [25]
QUESTION 10
a. Give a brief explanation of the following code. In your explanation include the web
programming language used, the purpose of each tag as well as the expected output.
<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php" method="post">


<input type="text" name="fname" required>
<input type="submit" value="Submit">
</form>

<p>If you click submit, without filling out the text field, your browser will display
an error message.</p>
</body>
</html>
Total Marks [25]

QUESTION 11
a. You are working for a consultant company and a client approaches you requesting for
clarification on the difference between server-side and client-side scripting. Write brief notes to
help the client differentiate the two concepts using the different web programming languages as
examples. [15]
b. Write brief notes about the following internet related concepts:

Page 3 of 11
i. IP addressing.
ii. Hosting.
iii. Domain Name Services.
iv. Service providers.
v. SQL injection. [10]
Total Marks [25]
QUESTION 12
a. Using code snippets, illustrate how you can perform data validation on a user form to
ensure data consistency and integrity using:
i. HTML [6]
ii. Javascript . [6]
b. Outline the steps you would take to connect a user form to a MySQL database using
XHTML for client-side scripting and PHP for server-side scripting. [13]
Total Marks [25]
QUESTION 13
a. You have been tasked by your web master to write a code to display the following:
i. Body text with font type aerial and text color as blue;
ii. All main heading (H1) to be in brown color;
iii. All paragraphs to be orange in color;
iv. Two specific areas in the page should have a special colouring one being green
and the other in yellow.
After spending the whole day duplicating code, your web master advises you to use CSS and
gives you the following code snippet to include in the header section of your file. However he
also highlights that there are a few errors that need to be debugged before the code can fully
work.

Page 4 of 11
Required:
i. Identify the errors in the code and rewrite the correct code [10]
ii. Write the complete HTML code so that it may link with the CSS code and display the
required results. [10]
iii. Outline five characteristics of a good website [5]
Total Marks [25]
QUESTION 14
a. Outline any four selectors used in CSS and also use code snippets to explain how each
can be used to style web pages. [15]
c. Form validation is generally classified into two categories namely basic validation and
data validation. Write simple code to show how HTML can be used to perform basic validation
on a form. [5]
d. Write a PHP code that alerts the user when a connection to the database has failed. [5]
Total Marks [25]

Page 5 of 11
QUESTION 15
a. You have tasked one of your subordinates to come up with a code for a simple HTML
program that accepts input from a user and save to a database using a PHP file. She presents you
with the following HTML code after failing to debug it. Assuming there is no error in the PHP
file help her debug the HTML code. [10]
<!DOCTYPE html>
<html language>
<body html>

<form action="action_page;php" method="post">


<inputted type="text" name="fname" required>
<inputted type="submit" value="Submit">
</forms>

<p>If you click submit, without filling out the text field, your browser will display
an error message. />

</body html >


</html language >

b. Outline and explain any five threats posed by using forms to collect customer information
online. [10]
c. Write a simple Javascript user defined function that uses the alert() function to print a
message to the user. [5]
Total Marks [25]

QUESTION 16
a. Outline and explain the evolution of web technologies from the early years of web based
system. Your explanation should include the benefits and challenges that have arisen as a result
of the introduction of each technology. [10]
b. Write HTML code snippets to achieve the following:
i. Create a checkbox. [2]
ii. Create a link to another web site. [2]
iii. Include an image to a web page. [2]
iv. Include a level 2 heading that is bold and italic [4]

Page 6 of 11
c. Briefly outline how flexbox can be used to improve a web site. [5]
Total Marks [25]
QUESTION 17
a. Briefly explain the development of the web technologies from web 1.0, web 2.0 and 3.0
citing the major changes and benefits in each phase. [15]
b. Write brief notes about the following internet related concepts:
i. World Wide Web.
ii. Protocols.
iii. Hacking.
iv. Internet Service providers.
v. Cloud computing. [10]
Total Marks [25]
QUESTION 18
a. Using code snippets show how XML, HTML and XHTML differ in the syntax and also
outline the strengths and weakness of each language. [12]
b. Outline the steps you would take to compile and run an HTML program. [13]
Total Marks [25]
QUESTION 19
a. Using code snippets, illustrate how you can use JavaScript or PHP to perform input
validation on a user form to ensure data consistency and integrity. [18]
b. Use external CSS to write a code that styles all main heading in a page to bold and blue
colour. [7]
Total Marks [25]
QUESTION 20
a. Outline the general structure and syntax of CSS and also explain each element suing
relevant examples. [15]
c. Write the code for adding an image onto a web page also explain purpose of each tag,
attribute and value.
[10]

Page 7 of 11
Total Marks [25]
QUESTION 21
a. Give a brief explanation of the following code. In your explanation include the purpose
of each element, attribute and value as well as the expected output.
<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php" method="post">


<input type="text" name="fname" required>
<input type="submit" value="Submit">
</form
<p>If you click submit, without filling out the text field, your browser will display
an error message.</p>

</body>
</html>
Total Marks [25]
QUESTION 22
a. Discuss how advancements in internet technologies have influenced web development in
terms of web content and user interactivity of web based applications. [15]
b. List and explain any three security threats that a web programmer should consider while
developing a web site for providing e-commerce services. [10]
Total Marks [25]
QUESTION 23
a. Using HTML and JavaScript design a user form that uses the prompt() and alert()
functions to prompt a user to enter two numbers and display the entered values on a pop-up
dialogue box. [15]
b. Write a JavaScript code that uses the onClick() event and a user defined function to
display the message “Thank you for using the system” when a user clicks the Exit link on a
user form. [10]
Total Marks [25]
QUESTION 24
a. You have been tasked by your web master to write a code to display the following:

Page 8 of 11
i. Body text with font type aerial and text color as blue;
ii. All main heading (H1) to be in brown color;
iii. All paragraphs to be orange in color;
After spending the whole day duplicating code, your web master advises you to use CSS and
gives you the following code snippet to include in the header section of your file. However he
also highlights that there are a few errors that need to be debugged before the code can fully
work.

Required:
i. Identify the HTML and CSS errors in the code and rewrite the correct code [10]
ii. State and justify the method that was used to implement CSS. [5]
iii. List five types of selectors used in CSS. [5]
iv. Using an example outline and example the elements of a CSS [5]

Page 9 of 11
Total Marks [25]
QUESTION 25
a. Using examples and code snippets where necessary outline and explain any five
categories of HTML tags. [15]
c. An HTML form has three mandatory fields Student Name, Student Surname and Student
ID, write HTML code snippet that would ensure that the form is not submitted until the fields are
filled. [5]
d. Compare and contrast HTML and XHTML [5]
Total Marks [25]
QUESTION 26
a. Write an algorithm (i.e. steps to be followed) for a PHP program that connects a user
form to a MySQL database running on XAMPP. [10]
b. PHP uses two methods for sending data from a user form to the database namely the
$_POST and $_GET methods. Explain the advantages and disadvantages of using each method
giving examples where necessary. [10]
c. List any five advantages of using PHP as a backend scripting language. [5]
Total Marks [25]
QUESTION 27
a. Using HTML code snippets show how you would:
i. Change background colour of the body to green. [3]
ii. Link to another web site. [3]
iii. A paragraph with all the text in italics. [4]
iv. Include a 3x3 table on a web page. [5]
v. Include an image on a web page. [3]
b. State and justify the HTML form controls you would use to achieve the following on a
web page:
i. Allow a user to select only one choice given a list of choices. [2]
ii. Allow a user to enter multiline text such as an address. [2]
iii. Allow a user to select multiple choices given a list of choices. [2]
iv. Allow a user to select country of origin [2]

Page 10 of 11
v. Allow a user to submit form details to a database [2]
vi. Allow user to upload a file [2]
Total Marks [25]

QUESTION 28
a. Write a script that accepts four integers entered by user through a form with the fields
named FirstNumber, SecondNumber, ThirdNumber and FourthNumber. The script should
display the sum of the intergers as well as the average. [8]

b. Write a PHP script that uses the POST method to store the four integers in (a) into an MySQL
database named StoreNumbers. [10]

c. Using code snippets show how you would achieve the following:
i. Declare a variable in JavaScript and PHP. [2]
ii. Implement a for loop in Javascript [2]
iii. Implement an if-else statement in PHP [2]
iv. Assign a value to a string variable in PHP [2]
[25 marks]
QUESTION 29
a. Outline the advantages and disadvantages of using content management software in web
development. You need to cite practical examples. [10]
b. Briefly outline the steps you would take to publish an article on a website using
i. Joomla [5]
ii. WordPress. [5]
c. Briefly explain the terms client side scripting and server side scripting as used in web
development. You must give examples of languages used in each of the methods. [5]
[25 marks]

Page 11 of 11

You might also like