Computer architecture and memory
Memory is a trade-off between speed and size: registers and cache are fastest but small; RAM is larger and volatile (lost when power goes off); ROM and storage drives keep data without power but are slower.
Networks and the OSI model
| Layer | Job |
|---|---|
| 7 Application | Services for the user, e.g. HTTP, email |
| 6 Presentation | Formats, encrypts and compresses data |
| 5 Session | Opens and closes conversations |
| 4 Transport | Reliable delivery, e.g. TCP |
| 3 Network | Routing with IP addresses |
| 2 Data link | Frames and MAC addresses |
| 1 Physical | Bits over cables or radio |
Databases
A relational database stores data in tables of rows (records) and columns (fields). A primary key uniquely identifies each row; a foreign key links to the primary key of another table. Normalisation removes repeated data: 1NF has no repeating groups, 2NF removes partial dependencies, and 3NF removes transitive dependencies.
C programming: arrays, functions and loops
An array stores many values of one type under one name: int marks[5]; holds five integers, indexed 0 to 4. A function groups code you can reuse: it has a return type, a name and parameters. Loops repeat code; nested loops (a loop inside a loop) print patterns and process 2D arrays.
Worked example
Write C code to find the sum of an array of 5 numbers.
- Declare: int a[5] = {4, 8, 1, 6, 3}; int sum = 0;
- Loop over every index: for (int i = 0; i < 5; i++)
- Add each element: sum = sum + a[i];
- Print it: printf("%d", sum);
Key words
Test yourself
Build your own quiz: pick topics, number of questions and a time limit. It's marked for you, with the working for every answer.
5 questions available
Build a quizQuestions students ask
How do I get full marks in C programming questions?
Write the complete program: #include, main(), variable declarations, correct syntax with semicolons, and clear output. Dry-run it on paper with sample values before you finish.
Is ICS a good choice for a software career?
Yes. ICS leads to BS Computer Science and Software Engineering, and the programming basics you learn here are used throughout university.
Want one-to-one help?
A checked Computer tutor, at home in Islamabad or Rawalpindi or online. The first 30 minutes are free.
Find a Computer tutor