Web Devpt Dec 2020

You might also like

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

MULUNGUSHI UNIVERSITY

IN ASSOCIATION WITH

EVELYN HONE COLLEGE OF APPLIED ARTS AND COMMERCE

ACADEMIC YEAR 2020 (DECEMBER)

DIPLOMA INFORMATION TECHNOLOGY

COURSE TITLE: WEB DEVELOPMENT

COURSE CODE – DIT 401


TIME: 3 HOURS TOTAL MARKS: 100
INSTRUCTIONS:

1. Do not turn over the page until you are told to do so.
2. There are seven (7) questions in this paper.
3. Question one (1) is compulsory
4. Attempt any four (4) questions from question two (2) to question seven (7).
5. Credit will be given for legible writing, proper punctuation and correct use of English.
6. No cell phones and/or calculators are allowed.

WARNING: Textbooks, laptops, exercise books, phones and other devices are not allowed in
the examination room. If found a candidate will be disqualified.
DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO
QUESTION ONE (Compulsory) [20 Marks]

i. What PHP variable is used to access URL variables?

a. $_FORM
b. $_FILES
c. $_GET
d. $_POST

ii. What has higher priority?

a. Styles define in a linked style sheet


b. Embedded styles
c. Inline styles
d. Browser default

iii. If you wanted to round the corners of a block element, which style property would you
apply?
a. border;
b. border-arc;
c. border-deg;
d. border-radius;

iv. If you wanted to remove the underline from a link, which style property would you use?

a. underline: none;
b. text-underline: 0px;
c. text-decoration: none;
d. border-bottom: 0px;

v. Consider the following PHP code: $var = “3” . “5”;


$var will most likely be:
a. Integer 8
b. Integer 15
c. String “35”
d. Integer (ascii value of character 3 times ascii value of character 5)
vi. Which CSS attribute is used to center text?
a. font-align
b. text-align
c. align
d. center
vii. In a standards-compliant web page, what is the outer-most structural tag?
a. <head>
b. <body>
c. <html>
d. <script>
viii. Which CSS attribute is used to center text?
a. font-align
b. align
c. text-align
d. center

ix. Which style property would you use to convert an inline level element to block level?
a. display: block;
b. element-level: block;
c. position: block;
d. layout: block;

x. Which MySQL command will select all the records from a table named “students” where
the value of the field “course” is “Biology”?
a. SELECT EACH FROM ‘students’ where course=’Biology’;
b. SELECT * FROM ‘students’ where course =’Biology’;
c. GET ALL FROM “students’ where field= course;
d. IMPORT * FROM ‘students’ where course =’Biology’;

True or False: Write the correct answer (True of False) in the right column

xi. ASP is Microsoft’s commercial web server software True or False


xii. The <a> tag is the block level element True or False
xiii. The <script> tag is used to insert PHP code into a web page True or False
xiv. The <head> tag includes the web page title True or False
xv. The <link> tag can be used to define a hypertext link True or False
xvi. In PHP, $myvar and $myVar are the same variable True or False
xvii. In a 3-tier web architecture the web server and the True or False
database server can be installed on the same computer.
xviii. Apache is a scripting language similar to PHP True or False
xix. Storing data in a database (instead of files) help increase True or False
data dependence and increase data redundancy
xx. The Internic is the name of the organization that makes True or False
recommendations about the standards for HTML and CSS
QUESTION TWO

A. Write HTML code that displays three global hyperlinks to different websites. The websites
should open in a new window when the user clicks on the hyperlinks. [6 Marks]
B. What is list? Explain the three (3) list types with relevant examples. [10 Marks]
C. Write css/html code that produces the following table in the web browser: [4 Marks]

First Name Last Name Savings


Praise Banda K100
Evelyn Chola K150
John Mwewa K300

QUESTION THREE

A. Explain any four (4) uses of JavaScript language. [8 Marks]


B. Explain with relevant examples the four ways of inserting JavaScript in an html page.
[8 Marks]
C. Write JavaScript code that can be used for page printing. [4 Marks]

QUESTION FOUR
A. Imagine that you are creating a web based database system called students record management
system for Evelyn Hone College. The system should have a table called students with the
following field names having 15 records of students:
i. Student First Name
ii. Student Last Name
iii. NRC
iv. Year of enrollment
v. Program

Note: The password for the database is STD3,the username is Hone and that it is locally hosted.

TASK

1. Write a php program that counts all the records of students in the system.
[11 Marks]
2. You have just finished designing a website for the company you are working for and your
boss would like to be advised on the type of hosting he/she can go for. Explain to her/him
the following types of web hosting by highlighting one (1) advantage and one (1)
disadvantage of each.
i) Shared hosting [3 Marks]
ii) Dedicated hosting [3 Marks]
iii) Free hosting [3 Marks]
TOTAL = [20 MARKS]

QUESTION FIVE

A. The CSS box model has four parts. List and explain the four parts from the inside to the
outside with the aid of the diagram. [8 Marks]
B. Differentiate the client side from the server side of a website by giving two example
programming languages of each. [4 Marks]
C. With the use of relevant JavaScript examples codes, explain both the onload and the unload
events. [8 Marks]

QUESTION SIX

A. Explain briefly the following elements that can go inside the $_SERVER super global variable.
i. $_SERVER['PHP_SELF'] [1 Mark]
ii. $_SERVER['SERVER_ADDR'] [1 Mark]
iii. $_SERVER['SERVER_NAME'] [1 Mark]
iv. $_SERVER['REMOTE_PORT'] [1 Mark]
B. Write a JavaScript program with the function name called HELLO. The program should then
display a message using an alert dialog box saying hello there Iam STD3 upon clicking on a
submit button. [10 Marks]
C. Explain the terms local and global variable by writing a php program. [6 Marks]

QUESTION SEVEN

A. Explain any two(2) differences between POST and GET. [4 Marks]


B. Write php code that can be used to display one record of the first name and the surname of
your choice from a table called stuffs. Use the while loop to loop through the records. The
code should use the following details to connect to the database:
i. Username=Mwewa
ii. Password=Banda
iii. Database Name=Payroll System
iv. Database Host=LocalHost [16 Marks]

You might also like