FAC1003 — Final Exam Scope 2025-2026

[!info] Sources Compiled from FAC1003 Exam Leaks 2025-2026 (Adian Sani + student revision notes).


Exam Structure

Part Type Qs Marks Total
Part A Conceptual (T/F, fill blanks, identify errors) Q1–Q2 12 each 24
Part B Write full C++ code Q3–Q6 14 each 56
Total 80

Lecture coverage: L19–L32 → mostly Part B


Grading — Know This

Rule Detail
Per line 1 mark/line of actual code
Boilerplate #include <iostream>, using namespace std;, int main(), return 0; = ½ mark each
Comments 0 marks — don't write them
Semicolons Won't be penalised harshly
Min length Write >14 lines even if logic is wrong — each line carries marks

Priority Topics — By Importance

🔴 Tier 1 — Guaranteed (Must Memorise Code)

1. Pointers & References

  • Pointer: int* ptr = &x;* to dereference, & for address-of
  • Reference: void swap(int &a, int &b)& in parameter declaration modifies original
  • Part A AND Part B will test both
void swap(int &a, int &b) {    // reference params
    int t = a; a = b; b = t;
}

2. Functions

  • Void — no return, does action (e.g. void displayMessage())
  • Non-void — returns value, needs return (e.g. int calculateFactorial(int n))
  • Function prototype — declares signature before use, must match definition in type & order

3. Recursion & Iteration — SAME QUESTION

  • Factorial — both recursion AND iteration in one question
  • Fibonacci — memorise the recursive code
  • Sum of factorial variation possible
// Factorial - recursion
int factorial(int n) {
    if (n <= 1) return 1;
    return n * factorial(n - 1);
}

// Factorial - iteration
int factorial(int n) {
    int r = 1;
    for (int i = 1; i <= n; i++) r *= i;
    return r;
}

// Fibonacci - MEMORISE
int fib(int n) {
    if (n <= 1) return n;
    return fib(n-1) + fib(n-2);
}

🟡 Tier 2 — High Priority

4. Loops

  • Know all three: do-while, while, for
  • break — commonly used; continue and goto — rare

5. Arrays (1D & 2D)

  • Basic usage, not extensive searching/sorting
  • 3D arrays — NOT tested
  • Strings via char arrays — possibly not that important

6. Scope of Variables

Scope Where Lifetime
Local Inside block That block only
Global Outside all functions Entire program
Static Inside function Entire run (retains value)

7. Dynamic Memory Allocation

int* arr = new int[size];
// use it
delete[] arr;

8. Vectors ⭐

VERY IMPORTANT for coding part. Know how to use vector.


🟢 Tier 3 — Conceptual Only (No Coding)

9. Encapsulation (4 Concepts)

Know the meaning, definition, and usage — from the video. No coding required.


❓ Maybe

Topic Notes
Passing & returning arrays Could ask for static array, dynamic array, or vector
Sum of factorial (non-void) Possible variation on factorial

Topics NOT in Exam

❌ Topic Notes
Time complexity Confirmed NOT IN EXAM
Constructors & destructors NOT included
Searching & sorting algorithms Not tested
Strings (extensively) Basic char array maybe ok
3D arrays No sign of it

Part A — TRUE/FALSE Cheat Sheet

# Statement Answer
1 A function can be called multiple times from main() TRUE
2 The function prototype must include the function's body FALSE
3 sqrt() requires <cmath> TRUE
4 Program flow starts from the called function before main() FALSE
5 Prototype params must match definition in type and order TRUE

Quick Reference — Key Distinctions

Concept Difference
Void vs Non-Void Void = no return. Non-void = returns value with return
Recursion vs Iteration Recursion = self-call + base case. Iteration = loop
Pointer vs Reference Pointer: * deref, & address-of. Reference: & in param
Pass by Value vs Reference Value = copy. Reference = modifies original

Study Strategy

  1. Memorise code blocks — factorial (recursive + iterative), fibonacci, swap with reference
  2. Practice function prototypes — fill-in-the-blank style
  3. Write full programs — include boilerplate, use >14 lines even if simple
  4. Don't waste time — no comments, no semicolon anxiety, no constructors
  5. Know encapsulation definitions — conceptual only, watch the video

Related