Past Papers, UOS Main Campus, Web System and Technologies

Web Systems and Technologies CS-3548 Mid Past Paper 2015 – UOS Main Campus

ExamMid Term
Year2015
Course codeCS-3548
CampusUOS Main
AnswersSolved ✓

University of Sargodha main campus (Department of Computer Science & Information Technology) Web Systems and Technologies (CS-3548) mid-term paper, held on Tuesday, 5 May 2015 (one hour). Retyped from the original paper, with solved answers below.

Paper set bySir PashaName as written on the original paper

Solved answers

Q1 – Short answers (10)

  1. <div> is a block-level container (starts on a new line, full width); <span> is an inline container used inside text.
  2. Cell spacing is the space between table cells; cell padding is the space between a cell’s border and its content.
  3. Meta tags (<meta> in the head) give information about the page — charset, description, keywords, author, viewport — used by browsers and search engines (SEO).
  4. The <script> tag.
  5. <h1> to <h6> (h1 largest).
  6. CSS selectors choose which elements a rule styles: element (p), class (.note), id (#main), descendant, attribute, pseudo-class (a:hover), universal (*).
  7. <style>#intro { color: blue; }</style> <p id="intro">Hello</p>
  8. Inline (style attribute), internal (<style> in the head) and external (<link rel="stylesheet" href="style.css">).
  9. An id must be unique on the page (#); a class can be used on many elements (.).
  10. Grouping applies one rule to several selectors: h1, h2, p { color: navy; }
  11. <header>, <nav>, <section>, <article>, <aside>, <footer>.
  12. email, date, number (also password, checkbox, radio).
  13. == compares values after type conversion ("5" == 5 is true); === compares value and type ("5" === 5 is false).
  14. An alert box only shows a message with an OK button; a confirm box has OK and Cancel and returns true/false.
  15. var a = [1, 2, 3]; or var a = new Array(1, 2, 3);
  16. var myArray = [[]]; creates an array containing one empty array — the start of a two-dimensional array.
  17. Wrap the script in an HTML comment inside the script tag, and use <noscript> for a fallback message.
  18. document.getElementById("demo").innerHTML reads content; document.getElementById("demo").innerHTML = "New text"; writes it.
  19. GET sends form data in the URL (visible, limited length, can be bookmarked); POST sends it in the request body (hidden, larger data, used for passwords and changes).
  20. alert(), confirm() and prompt().

Q2 – JavaScript structures (4)

// if-else
var marks = 72;
if (marks >= 50) { document.write("Pass"); } else { document.write("Fail"); }

// for
for (var i = 1; i <= 5; i++) { document.write(i + " "); }

// while
var n = 1;
while (n <= 5) { document.write(n + " "); n++; }

// switch
var day = 3;
switch (day) {
  case 1: document.write("Monday"); break;
  case 2: document.write("Tuesday"); break;
  case 3: document.write("Wednesday"); break;
  default: document.write("Other day");
}

Q3 – HTML form (6)

<form action="submit.php" method="post">
  <fieldset>
    <legend>Personal Information</legend>
    <label>Name</label><br>
    <input type="text" name="first" placeholder="First Name">
    <input type="text" name="last" placeholder="Last Name"><br>
    <label>Date of Birth</label><br>
    <input type="date" name="dob"><br>
    <label>Gender</label>
    <input type="radio" name="gender" value="male"> Male
    <input type="radio" name="gender" value="female"> Female<br>
    <label>Address</label><br>
    <input type="text" name="address"><br>
    <select name="country">
      <option value="">Select Country</option>
      <option>Pakistan</option>
      <option>Other</option>
    </select><br>
    <input type="submit" value="Submit">
  </fieldset>
</form>
Save this paper for offline studyDownload the question paper, or save the paper together with all solved answers as a PDF.
↓ Download Paper (JPG)

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.