Past Papers, UOS Main Campus, Web System and Technologies

Web Systems and Technologies Past Paper 2015 – MSc IT 3rd Term UOS (IT-3548) – Paper A

ProgramMSc IT
Term3rd
Year2015
Course codeIT-3548
AnswersSolved ✓

University of Sargodha M.Sc. IT 3rd term Web Systems & Technologies (IT-3548) paper, 2015 exam (Paper A, 80 marks, 2:30 hours). Two different papers for this course and year were found; this is the one starting with the <head> element question. It is retyped below, followed by solved answers for all 16 short questions and all six subjective questions: XML Schema, browser responsibilities, JavaScript DOM manipulation, URLs, ways of attaching CSS and how web servers deliver dynamic content.

Solved answers

Q1 – Short answers (16 × 2)

1. Elements inside <head>. <title>, <meta>, <link>, <style>, <script>, <base> and <noscript>.

2. Sessions. A session stores information about one user across several page requests on the server (HTTP itself is stateless). A unique session ID is kept in a cookie; e.g. in PHP session_start(); $_SESSION["user"] = "Ali";. Used for logins and shopping carts.

3. Purpose of JavaScript. Client-side scripting that makes pages interactive and dynamic: validating forms, reacting to events (clicks, keys), changing the DOM (content and styles), animations and AJAX requests without reloading the page.

4. Syntax of form element.

<form action="save.php" method="post" name="reg"
      enctype="multipart/form-data" target="_self">
  <input type="text" name="user">
  <input type="submit" value="Send">
</form>
Main attributes: action (URL that processes data), method (get/post), name/id, enctype, target, autocomplete, novalidate.

5. Purpose of <meta>. The <meta> element (inside <head>) gives metadata about the page that is not displayed: character set (<meta charset="UTF-8">), description and keywords for search engines, author, viewport for mobile devices, and refresh/redirect.

6. Role of XML in web applications. XML stores and transports structured data in a platform-independent text format: data exchange between client and server (AJAX, web services/SOAP), configuration files, RSS/Atom feeds, sitemaps, and documents like XHTML and SVG.

7. Famous web browsers. Google Chrome, Mozilla Firefox, Microsoft Edge, Apple Safari, Opera (older: Internet Explorer, Netscape Navigator).

8. <i> vs <em>. Both usually display italic text. <i> is presentational – text in an alternate voice (technical terms, foreign words) with no extra importance. <em> is semantic – it adds stress emphasis, which screen readers pronounce with emphasis.

9. Basic HTML5 page.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My Page</title>
</head>
<body>
  <h1>Hello World</h1>
  <p>My first HTML5 page.</p>
</body>
</html>

10. HTTP 200 OK. A success status code: the request succeeded and the response body contains the requested resource (for GET) or the result of the action (for POST).

11. POST vs GET. GET sends data in the URL query string – visible, length-limited, can be bookmarked and cached, used for searching/reading. POST sends data in the request body – not shown in the URL, no size limit, not cached, used for forms that change data, passwords and file uploads.

12. DHTML. Dynamic HTML – the combination of HTML, CSS, JavaScript and the DOM to create pages whose content and style change in the browser without reloading (menus, animations, drag-and-drop).

13. Secure Shell (SSH). A cryptographic network protocol (port 22) for secure remote login, command execution and file transfer (SCP/SFTP) over an insecure network; it encrypts all traffic and authenticates with passwords or keys.

14. PHP. PHP (Hypertext Preprocessor) is an open-source server-side scripting language embedded in HTML. The server runs the PHP code and sends the generated HTML to the browser; used for dynamic pages, forms, sessions and database access (MySQL), e.g. WordPress.

15. FTP. File Transfer Protocol (ports 20/21) – used to upload and download files between a client and a server (e.g. uploading website files); it sends data unencrypted, so SFTP/FTPS are preferred.

16. SOAP. Simple Object Access Protocol – an XML-based messaging protocol for web services; a SOAP message has an Envelope with optional Header and a Body, is usually sent over HTTP, and services are described with WSDL.

Q2 – XML Schema

An XML Schema (XSD) is an XML document that defines the legal structure of another XML document – which elements and attributes may appear, their order, how many times, and their data types. It replaces DTDs, is written in XML itself, supports data types and namespaces, and is used to validate documents.

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="student">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="name"  type="xs:string"/>
        <xs:element name="age"   type="xs:positiveInteger"/>
        <xs:element name="email" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="rollNo" type="xs:string" use="required"/>
    </xs:complexType>
  </xs:element>
</xs:schema>

A valid instance: <student rollNo="BSIT-101"><name>Ali</name><age>20</age></student>.

  • Simple types – elements with text only, built-in types (xs:string, xs:integer, xs:decimal, xs:date, xs:boolean) or restricted types using facets (minInclusive, maxLength, pattern, enumeration).
  • Complex types – elements containing other elements/attributes; indicators sequence (fixed order), all (any order), choice (one of).
  • Occurrence – minOccurs/maxOccurs; attributes with use=”required/optional”, default, fixed.
  • Advantages – data typing, namespaces, reuse through type definitions and inheritance (extension/restriction), XML syntax so the same tools can process it.

Q3 – Responsibilities and functionality of a browser

  • Request resources – takes a URL, resolves the domain with DNS, opens a TCP (TLS) connection and sends HTTP requests.
  • Receive and interpret responses – handles status codes, headers, cookies, redirects and caching.
  • Parse and render – the rendering engine parses HTML into the DOM, CSS into the CSSOM, builds the render tree, computes layout and paints pixels on screen.
  • Execute JavaScript – the JS engine (V8, SpiderMonkey) runs scripts that manipulate the DOM and handle events.
  • User interface – address bar, back/forward, bookmarks, tabs, history, downloads.
  • Data storage – cookies, localStorage, cache, saved passwords.
  • Security – same-origin policy, HTTPS certificate checking, sandboxing, pop-up and malware blocking.
  • Plug-ins/extensions and media – audio, video, PDF viewers.

Q4 – JavaScript approaches to manipulate HTML content

  1. document.write() – writes HTML into the page while it loads (old approach, overwrites the page if called later).
  2. innerHTML / textContent – read or replace the content of an element: document.getElementById("msg").innerHTML = "<b>Saved</b>";
  3. DOM methods – select elements (getElementById, getElementsByTagName, querySelector) and create/insert/remove nodes (createElement, appendChild, insertBefore, removeChild).
  4. Changing attributes and styles – img.src = "b.png", el.setAttribute("class","active"), el.style.color = "red", el.classList.add().
  5. Event handling – button.addEventListener("click", fn) to change content in response to user actions.
  6. AJAX / fetch – load data from the server and update parts of the page without reloading.
<p id="msg">Hello</p>
<button onclick="change()">Change</button>
<script>
function change() {
  var p = document.getElementById("msg");
  p.textContent = "Text changed by JavaScript";
  p.style.color = "blue";
  var li = document.createElement("li");
  li.textContent = "New item";
  document.body.appendChild(li);
}
</script>

Q5 – Uniform Resource Locator (URL)

A URL is the address of a resource on the web; it tells the browser what protocol to use, which server to contact and which resource to fetch.

https://www.example.com:443/papers/list.php?year=2015&term=3#results
\___/   \_____________/\__/\______________/ \________________/ \_____/
scheme      host       port      path              query        fragment
  • Scheme (protocol) – http, https, ftp, mailto, file.
  • Host – domain name or IP address of the server (resolved by DNS).
  • Port – optional; default 80 for HTTP, 443 for HTTPS.
  • Path – location of the resource on the server.
  • Query string – name=value pairs after ? separated by & (GET data).
  • Fragment – after #, a section within the page (not sent to the server).

URLs may be absolute (full address) or relative (images/logo.png) to the current page. Special characters are percent-encoded (space = %20). A URL is a type of URI.

Q6 – Ways of associating styles with HTML documents

Cascading Style Sheets (CSS) describe the presentation (colours, fonts, layout) of HTML documents, separating content from design. There are three ways to associate styles with a document:

  • Inline styles – the style attribute on one element: <p style="color:red; font-size:14pt">Hello</p>. Highest priority, but mixes style with content and cannot be reused.
  • Internal (embedded) style sheet – a <style> element in the <head>, applying to that page only:
    <style>
      body { font-family: Arial; background: #f5f5f5; }
      h1   { color: navy; }
      .note { border: 1px solid #999; padding: 8px; }
    </style>
  • External style sheet – rules saved in a separate .css file and linked to many pages: <link rel="stylesheet" href="style.css"> (or @import url("style.css"); inside a style block). Best for consistent site-wide design and caching.

Cascade and precedence: when rules conflict, inline beats internal/external, then more specific selectors (id > class > element) win, and among equal specificity the rule that comes last wins; !important overrides normal rules. Styles are also inherited by child elements.

Q7 – How a web server delivers dynamic content

Static content is sent as stored; dynamic content is generated for each request by a program.

  1. The browser sends an HTTP request, e.g. GET /result.php?roll=101 or a POST form submission.
  2. The web server (Apache, Nginx, IIS) examines the URL/extension and passes the request to the right handler instead of reading a file: CGI program, module (mod_php), FastCGI/PHP-FPM, Java servlet container, ASP.NET, Node.js.
  3. The server-side script reads input (query string, form data, cookies, session), applies business logic and usually queries a database (e.g. MySQL).
  4. The script generates the HTML (or JSON/XML) output and HTTP headers.
  5. The web server sends this response (status 200, Content-Type text/html) to the client, which renders it.

Techniques: CGI (a new process per request – simple but slow), server modules and FastCGI (persistent processes – faster), server-side scripting languages (PHP, JSP, ASP.NET, Python, Node.js), templates, and caching to reduce load. AJAX lets the browser request only data and update part of a page.

Save this paper for offline studyDownload the question paper, or save the paper together with all solved answers as a PDF.
↓ Download Paper (JPG)
Have another year of Web System and Technologies?

Upload a photo in 10 seconds — no form to fill. We clean it, solve it and credit you.

Missing years for this subject
202420232022

About Saif R

An educator and technology enthusiast passionate about empowering students through quality education and digital learning. Dedicated to making academic resources and opportunities accessible to everyone.