0% found this document useful (0 votes)
53 views

Web Programming Worksheet

Uploaded by

Ermias
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

Web Programming Worksheet

Uploaded by

Ermias
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Name: ________________________________________ ID No: ______________

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

___12. collection of related web pages L. Cookies, Sessions


___13. Web browser M. MySQL
___14. used to jump out of a loop or a N. Hypertext markup language
switch block
___15. Breaks one iteration (in the loop), if a O. DHTML
specified condition occurs, and proceed with
the next iteration in the loop.
___16. the distance between cells of a table. P. PHP, ASP.net

___17. the distance between the edges of Q. Java script


the cell to its content.

___18. an interpreted, client-side, event- R. /* …… */


based, objectoriented scripting language
___19. S. Cellspacing
___20. the father of HTML? T. Cellpadding
___21. HTML tag is used to insert an U. JavaScript
image?
___22. <a V. Tim Berners-Lee
href="https://www.sanfoundry.com/1000-
html-questions-answers/">HTML
MCQ</a>

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

(C) Web server

(D) Search Engine

_____2. 5) To get the ordered list we use

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

_____8. What will be the output of the following PHP code?


1. <?php
2. $team = "Ethiopia";
3. switch ($team) {
4. case "Keneya":
5. echo "I love Keneya";
6. case "Ethiopia":
7. echo "I love Ethiopia";
8. case "America":
9. echo "I love America"; }
10. ?>
A. I love America C. I love Ethiopia love America
B. I love Keneya D. I love Ethiopia
_____9.Which of the following is not a CMS
A. WordPress C. Joomla
B. Drupal D. SAP

_____10. Choose the correct HTML code to create an email link?


A. <A HREF = “[email protected]”></A>
B. <A HREF = “mailto: elifnesh @ghumti.com”></A>
C. <MAIL> elifnesh @ elf.com </MAIL>
D. <A MAILHREF = “elifnesh @ELF.com”></A>
_____11. Which one of the following is wrong about Web Architecture?
A. It is the conceptual structure of the internet.
B. In Client-server model two-tiered architecture, Clients and servers shared the
tasks and services that the system was supposed to perform.
C. three-tier model include an application logic between the client and the server

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
?>

_____16. Which of the following tags are related to Table in HTML?


A. <table> <th><row> <column> C. <table> <head> <body>
B. <table> <th><tr> <td> D. <table> <header> <footer>
_____17. What is the correct JavaScript syntax to write “Hello World”?
A.System.out.println(“Hello World”) C.document.write(“Hello World”)
B.println (“Hello World”) D.response.write(“Hello World”)
_____18. What will be the output of the following PHP code?
<?php
$club = array("Buna", "George", "Jima", "Bahirdarkenema",”Mekele”);
for ($x=0; $x < count($club); $x++) {
if ($club[$x] == "George")
break;
echo ($user[$x]);
}
?>
A. Buna C. Bahirdarkenema
B. Buna George D. Mekele
_____19. What is the path for an image located in same folder as the current page?

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

1. 0 – 600 Birr Non-Taxable –

2. 601-1,650 Birr 10% 60 Birr

3. 1,651 – 3,200 Birr 15% 142.50 Birr

4. 3,201 – 5,250 Birr 20% 302.50 Birr

5. 5,251 – 7,800 Birr 25% 565 Birr

6. 7,801 – 10,900 Birr 30% 955 Birr

7. Over 10,900 Birr 35% 1,500 Birr


Write the complete code to compute Net salary using php code with switch statement?

6
3. Write the html code to create the following table? 2pts

Name Favorite Color Code:

Bob Yellow

Michelle Purple

4. Write the html code to create the following form 2pts

Code:

5. Write the HTML code to display the following contents as it is. (2.5 points)

Our world has several information


communication media some of them are listed
below.
1. TV
2. Radio
3. Internet
4. Telephone
5. Newspaper
Internet is the one which changes the glob
into a very small village.

6. Write the following html tag output (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>

All HTTP status codes covering 1xx (Informational), 2xx (Success),


3xx (Redirection), 4xx (Client Error), and 5xx (Server Error) status
codes.

2xx successful – request was received and successfully performed.


3xx redirection – the request was redirected to another URL. 4xx client
error – the request was incorrect or invalid and cannot be fulfilled. 5xx
server error – problem on the server preventing it from fulfilling the
request.

When a hosting provider allocates space on a web server for a website to store its files, they are
hosting a website.

You might also like