0% found this document useful (0 votes)
11 views3 pages

HCT 114 2019

2019 HCT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

HCT 114 2019

2019 HCT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

UNIVERSITY OF ZIMBABWE

2019 March Examinations


Faculty: SCIENCE
Department: COMPUTER SCIENCE
Paper code and Title: HCT 114 INTERNET PROGRAMMING
Duration Two (2) HOURS
Examiner MR. N. ZANAMWE
Authorized Materials: N/A.
INSTRUCTIONS
1. This paper has Three Questions
2. Answer ALL Questions
3. Start each question on a new page
4. This paper comprises Four (3) Printed pages.
NB: DO NOT TURN OVER THE QUESTION PAPER OR COMMENCE WRITING UNTIL
INSTRUCTED TO DO SO

Page 1 of 3
Question 1 [24 Marks]

i. Describe the steps that you go through when developing a website. [14 marks]
ii. Suggest and explain five techniques that can be used to improve the loading speed of a website.
[10 marks]

Question 2 [41 Marks]

i. Write an html script to produce a table similar to the one given below. [10 marks]
Artist Song Release year
TK Smiling
2018
Maji
JJ
Nhamo 2017
SP Nzara 2016

ii. Write an html script to produce a list similar to the one given below (ignore background). [10 marks]
1. HCT
a. HCT120
b. HCT114
2. BCST
a. BS201
3. MTH
a. MTH114
b. MTH214
4. STH
a. STH134
b. STH11

iii. Assume that there is an image called za.jpg which is stored on the D drive of computer in sub-folder
named images. Also assume that you are developing a website and you are saving your webpages in
a folder called www which is on the D drive. You are required to:
a. write an html script which inserts the image (za.jpg) in a webpage saved in the www folder.
This image should have a height of 45px and length of 80px. In the event that the image fails
to render, alternative text ‘Image coming’ must be shown. [5 marks]
b. write a CSS script to position the image in part (a) above at an absolute position which is
110px from the left margin and 200px from the top margin. The image must have a padding of
5px and a solid red border which is 2px. [10 marks]
c. propose, justify and describe in detail the best approach of incorporating the CSS script in
part (b) in your html page given that there are 11 webpages in which the image in part (a) has
been inserted and the image must be styled the same across all webpages. [6 marks]

Page 2 of 3
Question3 [35 Marks]

Study the code given below and answer questions that follow.

1. <?php
2. $host = 'localhost';
3. $database = 'university';
4. $username = 'root';
5. $password = screte;
6. try
7. {
8. $dbh = new PDO("mysql:host=$hostname;dbname=$database,$username,$password);
9. //echo "The connection is successful";

10. catch()
11. {
a. echo $dbh->getMessage();
12. }
13. ?>

i. Using line numbers, identify all syntax errors in the code snippet above justify why you think they are
errors. [10 marks]
ii. Assuming that the above script is correct, write a PHP script to create a table called course in the
university database (the database already exists). The table must have three fields namely: narration,
code and program. [5 marks]
iii. Also making the same assumptions as in part (ii),
a. write a PHP script which inserts any three hypothetical records into the table called course
created in part (ii). [10 marks]
b. write a script which retrieves all the records from the course table and display them in a
Bootstrap table. [10 marks]

End of Question Paper

Page 3 of 3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy