Web Programming Worksheet
Web Programming Worksheet
Part I: Match The Items In A With B And Fill The Blank Spaces (1 PT.)
A B
___1. Server-side scripting A. Continue
___2. HTML, JavaScript, DOM and B. Break statement
CSS
___3. Listens for incoming requests C. UTF-8
for resources from clients and serves the
requests
___4. Multi Line Comment D. GLOBAL, Local and Static
___5. PHP variable scopes type E. //
___6. Testing type F. Unit , integration , functional and
system
___7. Coding method which covers G. Web server software
almost all of the characters and symbols in
the world.
___8. Solutions to keep track of the H. Web Site
client between requests
___9. Download I. Internet Explorer, Google Chrome
___10. Upload J. Copy information from the internet
___11. Multi-user and multi-threaded K. Store information on the internet
RDBMS server
1
HTML tag is used to define an internal style W. <img src=”htmllogo.jpg” />
sheet
X. Hyperlink in HTML Page?
Y. document.write(a); Windows.alert(),
and console.log()
Z. <style>
Part II: Choice the Correct Answer from the Given Alternatives and Write the
Answer in the Space Provided (1 pt. each)
_____1. Which program is used by web clients to
view the web pages?
(A) Web browser
(B) Protocol
a) <h1>
b) <ul>
c) <ol>
d) <ml>
_____3. Transferring your HTML code from one
machine to server is known as ___
(A) Indexing
(B) Hosting
(C) Serving
(D) Sorting
_____4. Which of the following is the default file extension of PHP files?
a) .php
b) .ph
c) .xml
d) .html
2
_____5. What is PHP?
a) PHP is an open-source programming language
b) PHP is used to develop dynamic and interactive websites
c) PHP is a server-side scripting language
d) All of the mentioned
_____6. Which of the following is the correct syntax to link an external style sheet in
the HTML file?
a) <link rel=”stylesheet” href=”style.css” />
b) <link rel=”stylesheet” src=”style.css” />
c) <style rel=”stylesheet” src=”style.css” />
d) <style rel=”stylesheet” link=”style.css” />
_____7. What will be the output of following code?
$a = 10;
echo “Value of a = $a”;
A. Value of a = 10 C. Undefined
B. Value of a = $a D. Syntax Error
3
D. Service-oriented architectures (SOA) include an application logic between the
client and the server
_____12. Which one of the following is wrong about the possible ways to apply CSS
styles to a web page?
A. CSS can be applied in three ways
B. Linked css create a separate .css file and add all the style for the web page
there where the file is linked to the HTML document(s) using the link tag
C. Embedded CSS created inside the HTML document, using a style tag and inside
that
D. Anchor tag is used to link the Inline CSS
_____13. Link to a specific location in another document:
A. <a href="chapter3.html#section3.1.1">Go to Section 3.1.1</a>
B. <a href="#section1">Go to Introduction</a>
C. <h2 id="section1">Introduction</h2>
D. <div id="section3.1.1"> <h3>3.1.1. Technical Background</h3></div>
_____14. How to define the link should open in new page in HTML?
A. <a href = “http://www.uct.com/” target = “blank”>ClickHere</a>
B. <a href = “http://www.uct.com/” target =“_blank”> Click Here </a>
C. <a href = “http://www.uct.com/” target = “#blank”>Click Here </a>
D. <a href = “http://uct.com”>
_____15. What is the output of the following?
<?php
$x=5;
$y=10; A. 15
Function mytest(){
global $x, $y; B. 5
$y=$y-$x;
} C. 10
mytest();
echo $y; D. 0
?>
4
A. <img src= “pic.jpg”> C. <img src= “images/pic.jpg”>
B. <img src= “../pic.jpg”> D. <img src= “/images/pic.jpg”>
_____20. Which one of the following is a Php-mysql code to Create connection?
A. $conn=mysqli_connect("localhost","username", "password“, ”mydb”) or
die("Connection failed: ". mysqli_connect_error());
B. $conn = mysqli_connect("mydb","localhost ", "username “, ” password”) or
die("Connection failed: ". mysqli_connect_error());
C. $sql = "CREATE TABLE MyGuests (id INT(6) UNSIGNED AUTO_INCREMENT
PRIMARY KEY, name VARCHAR(30) NOT NULL, email VARCHAR(50), reg_date
TIMESTAMP)";
D. $conn = mysqli_connect("localhost"," mydb ", "password“, ” username”) or
die("Connection failed: ". mysqli_connect_error());
_____21. What is the correct CSS syntax for making all the <p> elements bold?
A. <p style=”text-size:bold”> C. p {text-size:bold}
B. p {font-weight:bold} D. <p style=”font-size:bold”>
PART III Select the appropriate words and map with the blank space and write the
letter (1pt each)
A. include(" ”) G. mcrypt_encrypt M.colspan
B. MD5 H. GET
C. home page I. <select> N. welcome page
D. rowspan J. POST O. DNS
E. <div> K. marquee P. 5xx and 4xx
F. Prompt box L. require(" ") Q. HTTP
R. <protocol>://<host>[:<port>][<path>][?<query>]
_____1. ___ is a tag used to create a combo box (drop down box) .
_____2. ______ and ______ are methods used to send information from client browser to
web server.
_____3. Two functions that can be used to use a php file in another php code are
___________ and _______________.
_____4. The two encryption techniques widely used in PHP are _________ and ________.
_____5. _______is a container tag element for grouping and styling.
_____6. A ______________is used to enable scrolling text in a web page.
_____7. ____ and _____ are used to define a span in column and rows respectively.
_____8. The first page of a website is __________ .
_____9. HTTP responses message that indicate occurance of server error and client errors
are ____.
_____10. The exact address of a resource on the web Format is ______.
PART IV Part - IV: Write the Answer for the Following Questions Accordingly
(15pts)
1. Write HTML code to display an image as a link to a home page the file name of the
image is “home.gif”. The URL for the link is “index.htm”. 1.5pts
5
2. Given formulas on how to calculate personal (employee) income tax, pension, gross and
net income in Ethiopia. For comparison purpose, we have also added the old net salary,
pension and income tax calculation methods. (4.5pts)
a. Salary Income Tax = (Gross Salary * Tax Rate) – Deduction
b. Employee Pension – Gross Salary x 7%
c. Net Income = Gross Salary – Salary Income Tax – Employee Pension – Other
Taxes (If applicable)
d. Employee Pension – 7%
e. Company Pension – 11%
No. Salary Range (ETB) Tax Rate Deduction (ETB) Net salary
6
3. Write the html code to create the following table? 2pts
Bob Yellow
Michelle Purple
Code:
5. Write the HTML code to display the following contents as it is. (2.5 points)
7
<html><head>
<title>Universal Technology
College</title></head>
<body>
<table border=”1”>
<th>Sid</th><th>SName</
th><th>Dep.</th><th>Grade</th>
<tr><td>001</td><td>Hana</
td><td>CSIT</td><td>95</td></tr>
</table></body></html>
When a hosting provider allocates space on a web server for a website to store its files, they are
hosting a website.