Unit - 1
1. Answer any four of the following: (1x4=4)
(a) Define IP address. [1 Mark]
Answer: An IP (Internet Protocol) address is a unique numerical identifier assigned to each device connected to a computer network that uses the Internet Protocol for communication.
(b) What is a home page? [1 Mark]
Answer: A home page is the main introductory web page of a website that serves as the primary starting point and central navigation center for site visitors.
(c) What is DNS? [1 Mark]
Answer: DNS (Domain Name System) is a hierarchical decentralized system that translates human-readable domain names (such as www.example.com) into IP addresses.
(d) What is the full form of HTTPS? [1 Mark]
Answer: The full form of HTTPS is Hypertext Transfer Protocol Secure.
(e) What is a web server? [1 Mark]
Answer: A web server is a computer system (hardware and software) that stores web site content and serves web pages to client devices over the network via HTTP/HTTPS protocols.
2. Answer any one of the following questions: (2)
(a) Write down the difference between HTTP request and HTTP response. [2 Marks]
Answer:
| Feature | HTTP Request | HTTP Response |
|---|---|---|
| Origin | Sent by the client (web browser) to request web data. | Sent by the server back to the client. |
| Contents | Includes request method (GET/POST), URL, and client headers. | Includes status code (e.g., 200 OK, 404 Not Found) and requested resource content. |
(b) Explain the term 'domain registration'. [2 Marks]
Answer: Domain registration is the process of reserving and securing a unique domain name (such as example.com) on the Internet for a specific time period through an accredited domain registrar. Once registered, the domain owner holds exclusive rights to use that domain for their web services until expiration.
3. Answer any one of the following questions: (8)
(a) (i) Explain the basics of the Internet and the World Wide Web. Highlight their relationship. [4 Marks]
Answer:
Basics of the Internet
The Internet is a global system of interconnected computer networks that communicate using standard internet protocols (TCP/IP). It forms the physical infrastructure connecting millions of private, public, academic, commercial, and government devices worldwide, supporting services like email, file transfers, and web traffic.
Basics of the World Wide Web (WWW)
The World Wide Web is an information system operating over the Internet. It consists of interlinked digital documents, web pages, and multimedia resources accessible using Uniform Resource Locators (URLs) and transferred using protocols such as HTTP and HTTPS.
Relationship between Internet and WWW
- Infrastructure vs. Service: The Internet is the underlying physical network infrastructure (the highway network), whereas the WWW is an application service that operates on top of this network (the vehicles traveling on it).
- Dependency: The World Wide Web depends on the Internet to function, but the Internet supports many other services independent of the WWW, such as FTP, Email (SMTP), and VoIP.
(a) (ii) Discuss the differences among Static, Dynamic and Active web-pages with examples. [4 Marks]
Answer:
Web Page Classification
| Property | Static Web Page | Dynamic Web Page | Active Web Page |
|---|---|---|---|
| Definition | Delivers identical pre-stored HTML content to every client. | Generates dynamic content on the server side based on user inputs/data. | Runs interactive client-side scripts continuously within the browser environment. |
| Processing | No server-side scripting executed; simple HTML/CSS. | Server scripts (PHP, Node.js, Python) run before sending response. | Client-side scripts (JavaScript, WebAssembly) execute live in browser. |
| Content | Fixed content across all user visits. | Personalized content per user session or data query. | Real-time interactive components (e.g., interactive canvas, web tools). |
| Example | An online static resume or company privacy policy. | An e-commerce user dashboard or search engine results page. | Google Maps, browser games, interactive web photo editors. |
(b) (i) Write a detailed note on URL and its different parts with suitable examples. [4 Marks]
Answer:
Uniform Resource Locator (URL)
A URL is a web address that specifies the location of a resource on the Internet along with the protocol used to retrieve it.
Components of a URL
Consider the complete URL example: https://www.example.com:443/products/items.html?category=tech#details
- Scheme / Protocol:
https://– Defines the rule or protocol used for data communication. - Host / Domain Name:
www.example.com– Specifies the IP domain address of the host server. - Port:
:443– Indicates the network port on the server (443 for default HTTPS). - Path:
/products/items.html– Specifies the directory path and target document on the web server. - Query String:
?category=tech– Supplies parameters to the server using key-value pairs following a?mark. - Fragment / Anchor:
#details– Points to a specific bookmark section within the web page following a#mark.
(b) (ii) What are web browsers? Explain their main functions and applications. [4 Marks]
Answer:
Web Browsers
A web browser is a client-side software application designed to fetch, render, and navigate resources across the World Wide Web. Examples include Google Chrome, Mozilla Firefox, Microsoft Edge, and Safari.
Main Functions of Web Browsers
- Fetching Content: Sends HTTP/HTTPS requests to servers and receives HTML documents, styles, images, and scripts.
- HTML Parsing & Rendering: Converts raw HTML/CSS code into a visually structured interface using rendering engines.
- JavaScript Execution: Runs client-side dynamic logic using built-in JavaScript engines (e.g., V8 engine).
- Security & Privacy: Validates digital security certificates, enforces HTTPS protocols, manages cookies, and blocks malicious web threats.
Applications
- Accessing online web applications, educational portals, internet banking, and e-commerce platforms.
- Navigating global web content using tab management, bookmarks, and search features.
Unit - 2
4. Answer any four of the following questions: (1x4=4)
(a) What is an attribute in HTML? [1 Mark]
Answer: An attribute provides extra configuration information or properties to an HTML element, placed inside the opening tag as a name="value" pair.
(b) Write the syntax of an open tag with an example. [1 Mark]
Answer: Syntax: <tagname>. Example: <p> for opening a paragraph element.
(c) Name the tag used to insert a line break. [1 Mark]
Answer: The <br> tag is used to insert a line break in HTML.
(d) What is the purpose of the <title> tag? [1 Mark]
Answer: The <title> tag specifies the document title shown in the web browser's tab and search engine results.
(e) What does the <p> tag do? [1 Mark]
Answer: The <p> tag defines a text paragraph in HTML, automatically adding vertical margin spacing around the paragraph block.
5. Answer any one of the following questions: (2)
(a) Explain the difference between relative URL and absolute URL. [2 Marks]
Answer:
| Feature | Absolute URL | Relative URL |
|---|---|---|
| Definition | Contains the complete web path including protocol and domain name. | Points to a file relative to the current file location on the server. |
| Example | https://www.example.com/images/pic.png | images/pic.png or ../about.html |
(b) Mention two text formatting tags with example. [2 Marks]
Answer:
<strong>: Renders text in bold font to highlight strong importance. Example:<strong>Important</strong><em>: Displays text in italic style for emphasis. Example:<em>Note</em>
6. Answer any one of the following questions: (8)
(a) (i) Explain in detail the use of lists in HTML. Write an HTML code to display ordered, unordered and definition lists. [4 Marks]
Answer:
Use of Lists in HTML
Lists in HTML group related items together, establishing structured hierarchy, improving readability, and making navigation intuitive.
- Unordered List (
<ul>): Bulleted list format for unordered content. - Ordered List (
<ol>): Numbered or lettered sequence list format. - Definition/Description List (
<dl>): Displays term pairs (<dt>) along with their corresponding explanations (<dd>).
HTML Code Example
<!-- Unordered List --> <ul> <li>HTML</li> <li>CSS</li> </ul> <!-- Ordered List --> <ol> <li>Step 1</li> <li>Step 2</li> </ol> <!-- Definition List --> <dl> <dt>HTML</dt> <dd>HyperText Markup Language</dd> </dl>
(a) (ii) Write an HTML program to demonstrate the use of different text styles and arrangement. [4 Marks]
Answer:
<!DOCTYPE html>
<html>
<head>
<title>Text Styles and Layout</title>
</head>
<body>
<h1>Main Document Heading</h1>
<p>This sentence includes <strong>bold text</strong> and <em>italicized text</em>.</p>
<p>Chemical formula: H<sub>2</sub>O and math power: X<sup>2</sup>.</p>
<p>This paragraph shows <mark>highlighted text</mark> and <del>struck-through text</del>.</p>
<hr />
<p style="text-align: center;">Centered text alignment block.</p>
</body>
</html>
(b) (i) Write an HTML code to create a table with rows, columns and merged cells (rowspan and colspan). [4 Marks]
Answer:
<!DOCTYPE html>
<html>
<head>
<title>HTML Merged Table</title>
</head>
<body>
<table border="1">
<tr>
<th rowspan="2">Student Name</th>
<th colspan="2">Marks</th>
</tr>
<tr>
<th>Theory</th>
<th>Practical</th>
</tr>
<tr>
<td>John Doe</td>
<td>88</td>
<td>92</td>
</tr>
</table>
</body>
</html>
(b) (ii) Explain the use of form in HTML. Write HTML program to create a form with textbox and submit button. [4 Marks]
Answer:
Use of HTML Forms
HTML forms are used to gather user input data on a web page and submit it to a web server for further processing (such as logging in, searching, or registering).
HTML Code Example
<!DOCTYPE html>
<html>
<head>
<title>Basic HTML Form</title>
</head>
<body>
<h2>User Information Form</h2>
<form action="/submit_form" method="POST">
<label for="username">Enter Username:</label>
<input type="text" id="username" name="username" required />
<br /><br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
Unit - 3
7. Answer any four of the following questions: (1x4=4)
(a) What does JavaScript mainly do in webpage? [1 Mark]
Answer: JavaScript mainly adds interactivity, behavioral logic, dynamic rendering, and client-side data handling to web pages.
(b) Write the syntax for declaring a variable in JavaScript. [1 Mark]
Answer: Syntax: let variableName = value; or const variableName = value;.
(c) Name any two conditional statements used in JavaScript. [1 Mark]
Answer: Two conditional statements are the if...else statement and the switch statement.
(d) Write one feature of DHTML. [1 Mark]
Answer: DHTML enables web pages to dynamically change content, layout, and style properties in real time without requiring a full page refresh.
(e) What is the difference between '==' and '===' in JavaScript? [1 Mark]
Answer: == checks equality with type coercion, whereas === performs strict equality checking on both value and data type without coercion.
8. Answer any one of the following questions: (2)
(a) Differentiate between client-side scripting and server-side scripting. [2 Marks]
Answer:
| Feature | Client-Side Scripting | Server-Side Scripting |
|---|---|---|
| Execution | Runs locally within the client browser (e.g., JavaScript). | Runs on the remote host web server (e.g., PHP, Node.js). |
| Purpose | Enhances UI layout, handles user events, and input validation. | Processes business logic, queries databases, and generates HTML. |
(b) What are events in JavaScript? Give examples of two commonly used events. [2 Marks]
Answer: Events are actions or occurrences that happen in the browser (such as user interactions or system notifications) that JavaScript code can monitor and respond to.
onclick: Fires when a user clicks on an HTML element.onsubmit: Fires when a user submits a web form.
9. Answer any one of the following questions: (8)
(a) Explain the different types of loops in JavaScript with syntax and examples. [8 Marks]
Answer:
Overview of JavaScript Loops
Loops execute a block of code repeatedly while a specified logical condition remains true. They automate repetitive programming tasks efficienty.
1. For Loop
Used when the number of iterations is predetermined.
Syntax:
for (initialization; condition; increment) {
// Code block to execute
}
Example:
for (let i = 1; i <= 3; i++) {
console.log("Iteration: " + i);
}
2. While Loop
Evaluates the specified condition first and loops as long as the condition remains true.
Syntax:
while (condition) {
// Code block to execute
}
Example:
let i = 1;
while (i <= 3) {
console.log("Count: " + i);
i++;
}
3. Do-While Loop
Executes the code block once prior to evaluating the condition, guaranteeing at least one execution.
Syntax:
do {
// Code block to execute
} while (condition);
Example:
let i = 1;
do {
console.log("Value: " + i);
i++;
} while (i <= 3);
4. For-In Loop
Iterates over all enumerable key properties of an object.
Syntax: for (let key in object) { ... }
Example:
const user = { name: "Alice", role: "Admin" };
for (let key in user) {
console.log(key + ": " + user[key]);
}
5. For-Of Loop
Iterates directly over iterable elements (such as Arrays or Strings).
Syntax: for (let value of iterable) { ... }
Example:
const items = ["HTML", "CSS", "JS"];
for (let item of items) {
console.log(item);
}
(b) Compare and contrast HTML, JavaScript and DHTML in terms of purpose and usage in web development. [8 Marks]
Answer:
Introduction
Web development incorporates markup, scripting, and integrative techniques. HTML structures content, JavaScript provides behavioral control, and DHTML integrates these components for dynamic presentation.
Comparison Matrix
| Aspect | HTML | JavaScript | DHTML | Definition | Standard markup language for web document structure. | High-level programming scripting language. | 0
|---|---|---|---|
| An integrated web approach (HTML + CSS + DOM + JS). | |||
| Primary Function | Creates layout, headings, forms, links, and content. | Provides client-side dynamic logic and event handling. | Dynamically updates style and structural elements post-load. |
| Execution | Parsed and rendered by browser engine. | Interpreted by browser JavaScript engine. | Executes dynamic DOM manipulation in real time. |
| Interactivity | Static document interaction (clicking static links). | High programmatic interactive logic capability. | Dynamic UI changes without reloading the web page. |
| Feature | Strong Password | Weak Password |
|---|---|---|
| Length | Minimum 12 to 16 characters. | Fewer than 8 characters. |
| Character Mix | Combines uppercase, lowercase, numbers, and symbols. | Simple dictionary words, sequential numbers (12345), or simple names. |
| Security Level | Resistant to brute-force and dictionary attacks. | Cracked easily in seconds by automated tools. |
| Reuse | Unique across every account. | Reused across multiple web services. |
| Example | X#8k$W9!pL2@qR | password123 |
Role of Password Management in Cybersecurity
Managing credentials securely is central to protecting online identities. Password management tools help maintain robust access controls by:
- Secure Encryption: Storing user passwords inside encrypted digital vaults accessible via a single master password.
- Automated Complex Password Generation: Creating random, high-entropy unique passwords for every site.
- Phishing Prevention: Auto-filling saved credentials only on verified web domains.
- Multi-Factor Integration: Supporting MFA integration for strong defense-in-depth protection.
Conclusion
Using unique, strong passwords paired with secure password managers greatly lowers risk exposure against credential attacks.