0 · Exam Map COURSE DATA · FAQ
| Assessment | Weight | Format |
|---|---|---|
| Mid-Semester Quiz (Assessment 1) | 20% | Individual online quiz, Week 7; Weeks 1–5 |
| Web-Based Assignment 1 (Assessment 2) | 15% | Individual web assignment, Week 6 |
| Web-Based Assignment 2 (Assessment 3) | 25% | Individual web assignment, Week 12 |
| Final Exam (Assessment 4) | 40% | Formal examination; exam review sets 40% minimum |
Permitted materials · verbatim"What can I bring into the exam hall? Stationery. Non-programmable calculator. 1 A4 memory aid." (SENG1050 Formal Examination FAQs)
Practice-paper shape: 120 min + 10 min reading; A: 10 MCQ/20 marks; B: 6 short answers/50; C: 3 long answers/30. Section C = code writing + Huffman.
1 · Networks & Addressing W1–2
| Switching | Rule / cost |
|---|---|
| Circuit | Dedicated reserved path; reliable, but wastes capacity. |
| Message | Whole message stored then forwarded; needs large buffers. |
| Virtual circuit | Packets share a pre-set route; setup first. |
| Datagram | Each packet independent; Internet method; loss/order handled above. |
Routing chooses an end-to-end path and builds the table; forwarding uses header + table to move one arriving packet to an output. IP names/routes unreliably; TCP adds connection, ordering and reliability. Ports identify applications: HTTP 80, HTTPS 443.
IPv4 block → 8 bits using 128 64 32 16 8 4 2 1.
CIDR a.b.c.d/x: x leading bits identify network.
HTTP class: 1 info · 2 success · 3 redirect · 4 client · 5 server error.
2 · HTML Structure W2
Minimal valid document<!DOCTYPE html>
<html><head><meta charset="UTF-8">
<title>…</title></head>
<body><h1>…</h1>…</body></html>
| Need | Use / rule |
|---|---|
| Meaning | h1–h6, strong, em, lists; appearance belongs in CSS. |
| Link | <a href="…" >; relative inside site, absolute outside; #id for fragment. |
| Image | src plus useful alt text; no end tag. |
| Reserved text | < for <; character references prevent parsing as markup. |
| Validation | Fix the first reported error, then validate again. |
Head = metadata, title, encoding. Body = displayed content. An element is start tag + content + end tag; void elements have no content/end tag. Phrasing content cannot contain block content such as p.
3 · XML + DTD Method W3 · STARRED
| Test | Must hold |
|---|---|
| Well-formed | Declaration first; one root; close every element; proper nesting; quoted attributes; case matches. |
| Valid | Well-formed and conforms to its DTD: legal elements, order and attributes. |
| Text | PCDATA is parsed; CDATA leaves raw text alone; < and & otherwise need entities. |
<!ELEMENT menu (dish+)>
<!ELEMENT dish (name,price?)>
<!ATTLIST dish type CDATA #IMPLIED>
none=exactly 1 · +=1+ · *=0+ · ?=0/1
, = sequence · | = choice
Exam First classify well-formed versus valid; a syntactically correct tree may still violate the DTD.
4 · CSS Rule Selection W4 · STARRED
| Selector | Meaning |
|---|---|
| div p / div > p | Any descendant / direct child. |
5 · Forms + Layout W5
| GET | POST |
|---|---|
| name=value pairs appended after ? in URL | Values in request body |
| Bookmark/share; searches and filters | Logins, payments, stored-data changes |
| Length-limited; never sensitive data | No practical size limit; still needs secure transport |
Every control needs a name; it becomes the server key. Match label for to control id. Radios in one group share a name and allow one value; checkboxes allow several. Group with fieldset + legend. Form action = receiving program.
Table: caption → thead/tbody → tr → th/td.
colspan reduces cells in that row; rowspan occupies position in later rows.
| Layout | Behaviour |
|---|---|
| normal flow | Blocks stack; inline boxes run along a line. |
| relative | Offset; original gap remains. |
| absolute | Out of flow; nearest positioned ancestor. |
| fixed / sticky | Viewport-fixed / normal until threshold. |
| flex | Arranges children on row or column axis. |
6 · Client–Server + PHP W6
| Client–server | Peer-to-peer |
|---|---|
| Central storage, trusted source, one place for rules/backup. | Each device is client and server; contributes resources. |
| Server may be failure point, target and bottleneck. | No central control; harder security/consistency. |
Apache: document root publishes files; virtual hosts allow multiple sites. ServerSignature Off + ServerTokens Prod reduce leakage. Browser gets PHP output, not source.
$qty=(int)$_GET["qty"];
$price=(float)$_GET["price"];
$total=$qty*$price;
echo "<p>$total</p>";
7 · CMS + XPath W7
CMA = authorised administrative back end that creates/edits content. CDA = public read-only front end that compiles/caches pages. Apply least privilege.
| XPath | Selects |
|---|---|
| /cinema/film | Absolute path from root. |
| //title | Every title at any depth. |
| film[1] | First film; XPath positions start at 1. |
| film[@rating] | Films having rating attribute. |
| film[@id="f1"]/title | Title of matched film. |
| * / @* | Any element / attribute. |
$xml=simplexml_load_file("films.xml");
$nodes=$xml->xpath('//film[@rating]');
foreach($nodes as $film) echo $film->title;
xpath() returns an array; use [0] for first node. XPath counts from 1; PHP arrays from 0. Attribute: $film["rating"].
CSS conflict checkpoint
source priority → specificity IDs | classes+pseudo | elements → exact tie: later rule wins.
One ID outranks any number of classes. External CSS holds rules only. Link reset before your sheet. px = 1/96 inch; em follows parent; rem follows root.
8 · JavaScript + DOM W8
function checkQty(){
var q=document.getElementById("qty").value;
if(q===""){alert("Enter quantity");return false;}
return true;}
<form onsubmit="return checkQty();">
| Control | Read / fail test |
|---|---|
| text | .value === "" |
| checkbox | .checked true/false |
| radio group | Loop; at least one checked |
| select | selectedIndex is 0-based |
9 · Site Design + SEO W9
| Design | Application |
|---|---|
| Repetition | Consistent elements/navigation. |
| Contrast | Attention + readable colour difference. |
| Proximity | Group related items. |
| Alignment | Create visual unity. |
| Accessibility | Perceivable, operable, understandable, robust. |
Speed: size/compress/lazy-load images; defer blocking JS; load essential CSS first. The lecture warns that pages over about three seconds lose roughly half their traffic. Responsive: flexible layout + media queries.
Structure: linear suits fixed sequences; augmented linear adds a return-to-start link; hierarchy suits categories. Avoid a hierarchy so deep that the three-click rule fails or so broad that menus exceed about four manageable chunks.
SEO: unique title, meta description, natural keywords, alt text, clear links and trusted inbound links. A sitemap helps large or new sites with few external links. Crawlers read markup/text. SEO = organic; paid listings = search marketing.
10 · Encoding + Compression W10 · CERTAIN
| Method | Rule |
|---|---|
| Parity | Makes ones even/odd; can miss two flips. |
| CRC | Polynomial→bits; append k−1 zeros; XOR-divide. |
| Run length | Count+symbol for repeated runs. |
| Huffman | Merge two lowest; left 0/right 1; prefix-free. |
| Lossless/lossy | Exact reconstruction / discards detail. |
original=characters×8
compressed=Σ(frequency×code length)
saving=1−compressed/original
Huffman ties may change codes, not total bits. State tie rule. ASCII = 7 bits; Unicode covers over a million characters; UTF-8 uses 8-bit units. Week 10 marks CRC + Huffman as certain exam content.
11 · Encryption Chooser W11
| Goal | Method |
|---|---|
| Confidentiality | Recipient public → recipient private. |
| Origin + integrity | Hash; sender private signs; sender public verifies. |
| Fast bulk data | Symmetric shared key. |
| Trust a key | Certificate authority signs identity+public key. |
Goals: authentication, integrity, non-repudiation, confidentiality. TLS/PGP use asymmetric encryption to carry a random session key, then symmetric encryption for data. A certificate contains owner identity and public key, issuer, validity period, serial number and issuer signature.
RSA: primes p,q → n=pq → φ=(p−1)(q−1) → public e coprime with φ → private d: ed≡1 (mod φ).
Substitution preserves frequencies; transposition reorders; XOR flips bits. A counterfeit-key attacker substitutes a directory key; certificate signatures defend the binding. Always name whose key.
12 · Security, Privacy, Ethics W12
| Pair | Distinction |
|---|---|
| Virus / worm | Host file must run / spreads unaided. |
| Phishing / pharming | Deceives person / alters DNS mapping. |
| DoS | Floods service so real users cannot be served. |
| Opt-in / opt-out | Nothing until agreement / collected unless refused. |
Cookies are text files, not executable, but permit tracking. Personally identifiable information identifies, locates or contacts a person. Informed consent follows full relevant disclosure. Ethics asks right/wrong; law is government-made rules—legal need not mean ethical.
Answer Threat → attack stage → targeted layered defence → how it breaks that stage.