Blog
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)
<div>is a block-level container (starts on a new line, full width);<span>is an inline container used inside text.- Cell spacing is the space between table cells; cell padding is the space between a cell’s border and its content.
- Meta tags (
<meta>in the head) give information about the page — charset, description, keywords, author, viewport — used by browsers and search engines (SEO). - The
<script>tag. <h1>to<h6>(h1 largest).- CSS selectors choose which elements a rule styles: element (
p), class (.note), id (#main), descendant, attribute, pseudo-class (a:hover), universal (*). <style>#intro { color: blue; }</style> <p id="intro">Hello</p>- Inline (
styleattribute), internal (<style>in the head) and external (<link rel="stylesheet" href="style.css">). - An id must be unique on the page (
#); a class can be used on many elements (.). - Grouping applies one rule to several selectors:
h1, h2, p { color: navy; } <header>,<nav>,<section>,<article>,<aside>,<footer>.email,date,number(alsopassword,checkbox,radio).==compares values after type conversion ("5" == 5is true);===compares value and type ("5" === 5is false).- An alert box only shows a message with an OK button; a confirm box has OK and Cancel and returns true/false.
var a = [1, 2, 3];orvar a = new Array(1, 2, 3);var myArray = [[]];creates an array containing one empty array — the start of a two-dimensional array.- Wrap the script in an HTML comment inside the script tag, and use
<noscript>for a fallback message. document.getElementById("demo").innerHTMLreads content;document.getElementById("demo").innerHTML = "New text";writes it.- 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).
alert(),confirm()andprompt().
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.
