Section E · Computer Networks Topology Case Study (5 Marks) (5 Marks)
In a 4-building campus, Block C has 120 computers while Blocks A, B, D have 25–40 each. Suggest: (i) Server placement, (ii) Cable layout, (iii) Switch vs Repeater placement, (iv) WAN link for hilly terrain.
- (i) Place Server in Block C (maximum number of computers — reduces intra-LAN traffic bottleneck).
- (ii) Draw Star/Bus shortest-distance cable layout connecting all blocks cleanly without loops.
- (iii) Switch in every block (to interconnect computers); Repeater only on segments exceeding 90–100m.
- (iv) Radio wave / Microwave / Satellite link for hilly terrain where cabling fails.
Final Answer: (i) Block C · (ii) Shortest Star layout · (iii) Switch in all blocks, Repeater >100m · (iv) Radio/Microwave. (1 mark each subpart + 1 mark justification.)
Section C · Python Text & Binary File Handling (3 Marks) (3 Marks)
Write a Python function CountLines() to read "STORY.TXT" and display the count of lines that start with the vowel "A" or "E" (case-insensitive).
- Open file safely with `with open("STORY.TXT", "r") as f:` and read lines via `f.readlines()`.
- Check `line.strip()` non-empty and `line.lstrip()[0].upper() in ("A", "E")` to avoid IndexError on blank lines.
- Increment counter and print total count cleanly.
Final Answer: count = sum(1 for ln in f if ln.strip() and ln.lstrip()[0].upper() in ("A", "E")) (1m correct file open/close · 1m loop & uppercase/vowel logic · 1m accurate output print.)
Section D · MySQL Aggregate & JOIN Queries (4 Marks) (4 Marks)
Given tables ITEM(ICode, IName, Price, VCode) and VENDOR(VCode, VName, City), write SQL to: (i) Count items per vendor where count > 2, (ii) Display IName, Price, VName sorted by Price descending.
- (i) SELECT VCode, COUNT(*) FROM ITEM GROUP BY VCode HAVING COUNT(*) > 2;
- (ii) SELECT I.IName, I.Price, V.VName FROM ITEM I, VENDOR V WHERE I.VCode = V.VCode ORDER BY I.Price DESC;
Final Answer: Use HAVING after GROUP BY and qualify shared VCode column with table aliases. (2m GROUP BY + HAVING syntax · 2m Equi-Join with ORDER BY DESC.)