Web Technology Examination Questions

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

SleimDroid Innovations

SECOND SEMESTER EXAMINATION 2023/2024 ACADEMIC SESSION


COM225 – WEB TECHNOLOGY (3 Units)

INSTRUCTION: This paper consists of seven (7) questions. You are required to attempt any five (5)

1. a) Write the basic structure of a webpage, explaining the purpose of the


<!DOCTYPE> , <html> , <head> , and <body> tags.
b) Write the HTML code to create the table as shown below
SN Name Dep_id School_id MatricNo
1 John Anderson 7 9 FPE/COM/124
2 Emily Carter 5 12 FPE/COM/112
3 Michael Thompson 1 1 FPE/COM/001
4 Sarah Brooks 2 2 FPE/COM/101

2. a) Describe how to create a link that opens in a new browser tab.


b) Explain the use of the title attribute in an anchor (<a>) tag.
c) Using an if-else statement, write JavaScript code to check if a user’s age is 18 or older. If true, output
“Adult”; otherwise, output “Minor.”

3. a) Write the HTML code to create an ordered list, an unordered list with three items each.
b) List six types of input elements used in HTML forms and provide a code example for each.
c) Write HTML code to create a table with three columns and four rows. Add a header row with
column names.

4. a) Write CSS code to change the color of a link when hovered or visited.
b) List six data types in JavaScript, providing an example for each.
c) Create a table with columns labeled SN , Name , and Score and add three rows of sample data.

5. a) Write a for loop to print numbers from 1 to 5.


b) Explain the difference between the <section> and <aside> tags and provide examples of each.
c) Differentiate between padding and margin in CSS, and provide an example where each would be
appropriate.

6. a) Compare HTML and XHTML. Explain key differences and situations where XHTML may be
preferred.
b) List 6 distinct HTML elements and give an example each of their usages

c) The <div> element below have certain width and height which are unknown, using CSS
(inline, internal or external), style the <img> to take the exact same width and height of the <div>
element.

<div>
<img src = “study_img.jpg” alt = “Image”>
<div>

7. a) Using JavaScript if-else statement, write codes to check if the value of variable ‘a’ is greater than
the value of variable ‘b’. and if so, assign greatest to variable ‘’a_is’’, otherwise assign greatest to
variable “b_is”;

b) Write the HTML code to create a table with the following columns: ID, Product Name, Quantity,
Price, Total.
c) Link the CSS file to the html document below. What would be the effect on the html document
when successfully linked

HTML CSS (style.css)


<!DOCTYPE html> body{
<html> font-family: Helvetica;
<head> color: #001c37 !important;
<title>Page Title</title> font-size: 13px !important;
</head> line-height: 16px;
<body> font-weight: 400;
<h1>My First Heading</h1> }
<p>My first paragraph.</p> h1{
</body> color: red;
</html> font-size: 24px;
}

<strong> Best luck! </strong>

You might also like