01 ICT MODULE ONE REVISION

02 ICT MODULE TWO REVISION

03 ICT MODULE THREE REVISION

01 NOVEMBER 2024 PAST PAPERS ANSWERS
About Lesson

 


Question 1

(a) Outline the function of each of the following types of computer software:

(i) Proprietary software

  • This is software owned by an individual or a company, and its use, modification, and distribution are restricted.
  • Example: Microsoft Windows, Adobe Photoshop.

(ii) Shareware

  • Software that is distributed for free on a trial basis but requires payment for continued use or full functionality.
  • Example: WinRAR, some versions of antivirus software.

(iii) Utility software

  • Programs designed to help manage, maintain, and optimize computer performance.
  • Example: Disk cleanup tools, antivirus software, backup utilities.

(b) Explain each of the following features of a word processor:

(i) Footnote

  • A note placed at the bottom of a page to provide additional information or citations.
  • Commonly used in academic and professional documents for referencing sources.

(ii) Table of Content (TOC)

  • A structured list of document sections with corresponding page numbers.
  • Automatically generated in word processors to enhance document navigation.

(c) A computer technician prefers to use a command-line operating system when faced with computer diagnostic problems. Outline four characteristics of this operating system that make it suitable for the task.

  1. Lightweight – Uses minimal system resources.
  2. Direct Hardware Access – Allows deeper control of system components.
  3. Powerful Commands – Provides advanced commands for troubleshooting.
  4. Scriptable – Allows automation of diagnostic tasks using scripts.

(d) Differentiate between slide layout and master slides as used in a presentation program.

  • Slide Layout: Predefined arrangement of content placeholders in a single slide.
  • Master Slide: A template that controls the appearance of all slides in a presentation.

Question 2

(a) Outline three factors to consider when attaching an electronic file to an email.

  1. File size – Large files may exceed email attachment limits.
  2. File format – Ensure the recipient can open the file.
  3. Security – Scan the file for viruses before sending.

(b) Differentiate between Distributed Operating Systems (DOS) and Network Operating Systems (NOS).

  • Distributed Operating System (DOS): Manages multiple computers working together as a single system.
  • Network Operating System (NOS): Manages and controls network resources like shared printers and files.

(c) John intends to change the appearance of a graphic created using a DTP program. Outline four features he is likely to use to achieve his goal.

  1. Crop tool – Adjusts the size of an image.
  2. Color adjustment – Changes color tones or brightness.
  3. Layering – Arranges elements in front or behind others.
  4. Text wrapping – Places text around an image.

(d) State the output when each of the following criteria is applied in a database query on a field named “Item”:

  • Like “Computer%” → Returns records starting with “Computer”.
  • *Like “ter” → Returns records ending with “ter”.
  • Like “Te?” → Returns records with three letters starting with “Te”.
  • Like “C#” → Returns records where “C” is followed by any single character.

(e) Outline three domain codes used in the Universal Resource Locator (URL) used on the internet.

  1. .com – Commercial websites.
  2. .org – Nonprofit organizations.
  3. .edu – Educational institutions.

(f) Explain the function of each of the following features in a word processor:

(i) Bookmark: A marker used for quick navigation within a document.
(ii) Comments: Notes added to a document for review purposes.

(g) Differentiate between column guides and modular grids as used in desktop publishing programs.

  • Column Guides: Lines that define column boundaries in page layout.
  • Modular Grids: A grid system that helps in aligning text and images.

(h) Peter opted to use a template when designing a publication for a school sports day. Explain two benefits he derived from using templates.

  1. Saves time – No need to start from scratch.
  2. Ensures consistency – Maintains uniform formatting.

(i) Awinga used guides when designing a publication in a desktop publishing program. Outline three advantages she gained from using these guides.

  1. Aligns objects accurately.
  2. Improves layout organization.
  3. Ensures consistency in design.

(j) Explain two benefits of including the Subject field in an email.

  1. Helps recipients identify email content quickly.
  2. Improves email searchability.

 


Question 4

(a) State the difference between $1 and $A$1 cell reference when used in a spreadsheet program formula.

  • $1 – Refers to a fixed row (e.g., A$1).
  • $A$1 – Absolute reference that remains fixed when copied.

(b) A database is to be created with two tables, one for storing personal details and another for storing birth certificate details. Explain the type of relationship that can be applied to the tables, giving a reason.

  • One-to-One Relationship – Each person has only one birth certificate.

(c) Explain two activities carried out by a database administrator in each of the following database administration tasks:

(i) Implementation:

  1. Creating database structures.
  2. Setting access permissions.

(ii) Recovery:

  1. Restoring lost data.
  2. Creating database backups.

(d) A spreadsheet user was tasked with customizing the column chart axis labels. Outline four ways he could achieve this.

  1. Change font style.
  2. Adjust label position.
  3. Modify text orientation.
  4. Use different colors.

(e) An organization opted to use a hierarchical database model to manage their data. Outline four characteristics of data that necessitated the use of this type of model.

  1. Parent-child relationships.
  2. One-to-many data structure.
  3. Data stored in tree format.
  4. Fast data retrieval for structured queries.

Question 5

(a) State the meaning of the term objects as used in database management systems.

  • Database components like tables, queries, forms, and reports.

(b) State two examples of keys that can be used to enforce data integrity in a database management system.

  1. Primary Key – Uniquely identifies each record.
  2. Foreign Key – Links tables through a relational connection.

Question 6

(a) Explain each of the following features in a desktop publishing program:

(i) Grids: Alignment tools for text and images.
(ii) Typography: Formatting features for text appearance.

(b) Distinguish between querying a single field condition and querying a multiple field condition, giving an example in each case.

  • Single field query: Filters records using one column (e.g., “Age > 18”).
  • Multiple field query: Filters records using multiple conditions (e.g., “Age > 18 AND Gender = ‘Male'”).

(c) Explain the function of a conditional formatting feature in a spreadsheet application.

  • Automatically changes cell formatting based on set conditions.

(d) A spreadsheet extract shows the distribution of trainees in departments.

(i) Function to count trainees in the ICT department:

  • =COUNTIF(A2:A20, "ICT")

(ii) Outline two reasons for applying different font types in a DTP program.

  1. Enhances readability.
  2. Adds emphasis to key information.

 

Question 7  

(e) Describe two pre-processor directives in C programming language.

  1. #include – Used to include header files in a program (e.g., #include <stdio.h>).
  2. #define – Used to define macros or constants (e.g., #define PI 3.14).

(f) Explain two circumstances in which a stack data structure could be used in a program.

  1. Function calls and recursion – The stack stores function calls and returns values in a Last In, First Out (LIFO) manner.
  2. Undo operations in applications – Used to keep track of previous actions, such as in text editors.

(g) Differentiate between append and close functions as used in Pascal file handling.

  • append – Opens a file for writing while preserving existing data. New data is added at the end.
  • close – Closes a file after reading or writing operations.

Question 1

(a) Outline four programming paradigm shifts in order of occurrence.

  1. Procedural programming – Uses functions and procedures (e.g., C, Pascal).
  2. Object-oriented programming – Uses objects and classes (e.g., Java, Python).
  3. Functional programming – Focuses on pure functions and immutability (e.g., Lisp, Haskell).
  4. Event-driven programming – Responds to user or system events (e.g., JavaScript, Node.js).

(b) Explain the following terms as used in programming:

(i) Iteration – The process of repeating a set of instructions using loops such as for, while, and do-while.
(ii) Breakpoint – A debugging tool that pauses program execution at a specific line to inspect variables and execution flow.

(c) Jenette used an Integrated Development Environment (IDE) for C programming. Describe three necessary requirements of this environment.

  1. Code editor – Allows writing and editing of source code.
  2. Compiler – Translates source code into machine code.
  3. Debugger – Helps identify and fix errors in the code.

Question 2

(a) State three Boolean operators used in programming.

  1. AND (&& or AND) – Returns true if both conditions are true.
  2. OR (|| or OR) – Returns true if at least one condition is true.
  3. NOT (! or NOT) – Reverses the truth value of a condition.

(b) Describe two parameter passing mechanisms in programming.

  1. Pass by value – A copy of the variable is passed, and changes do not affect the original value.
  2. Pass by reference – The actual memory address is passed, allowing changes to affect the original value.

(c) James used the following names in Pascal: label, new, number, type. Classify each as either an identifier or a keyword.

  • Keywords: label, new, type (reserved words in Pascal).
  • Identifier: number (a user-defined name).

(d) Distinguish between enumerated and sub-range data types as used in Pascal.

  • Enumerated data type – Defines a set of named values (e.g., type Colors = (Red, Blue, Green);).
  • Sub-range data type – Restricts a variable to a specified range (e.g., var Age: 1..100;).

Question 3

(a) Outline four limitations of using pointers in programming.

  1. Complexity – Difficult to understand and debug.
  2. Security risks – Can lead to memory corruption if misused.
  3. Memory leaks – Improper handling can cause memory not to be freed.
  4. Difficult debugging – Errors like segmentation faults can be hard to trace.

(b) Explain the term argument as used in programming.
An argument is a value or variable passed to a function when calling it.

(c) With the aid of an example, distinguish between linear and nonlinear data structures.

  • Linear data structure – Elements are arranged sequentially (e.g., arrays, linked lists). Example:
    int numbers[5] = {1, 2, 3, 4, 5};
    
  • Nonlinear data structure – Elements are arranged hierarchically (e.g., trees, graphs). Example:
    struct Node {
        int data;
        struct Node *left, *right;
    };
    

(d) Evaluate the following expression in C:

4 * 9 / (16 - 2) + 4;

Solution:

  1. 16 - 2 = 14
  2. 4 * 9 = 36
  3. 36 / 14 = 2 (integer division)
  4. 2 + 4 = 6
    Final Output: 6

Question 4

(a) Write a Pascal program that defines a function to compute the square root of a number.

program SquareRootCalculator;
uses math;
function FindSquareRoot(num: real): real;
begin
  FindSquareRoot := sqrt(num);
end;
var
  number: real;
begin
  write('Enter a number: ');
  readln(number);
  writeln('Square root: ', FindSquareRoot(number):0:2);
end.

(b) Define the following stages in the program development cycle:

(i) Design – The process of planning the structure of a program, including algorithms, flowcharts, and data structures.
(ii) Coding – The actual writing of the program using a programming language based on the design specifications.


(c) Differentiate between unary and binary operators in C programming.

  • Unary operator – Operates on a single operand (e.g., ++, --, !).
    int x = 5;
    x++;  // Increment operator
    
  • Binary operator – Operates on two operands (e.g., +, -, *).
    int sum = 4 + 5;  // Addition operator
    

(d) Write a C program to check if a password matches.

#include <stdio.h>
#include <string.h>

int main() {
    char password1[20], password2[20];
    
    printf("Enter password: ");
    scanf("%s", password1);
    
    printf("Re-enter password: ");
    scanf("%s", password2);
    
    if (strcmp(password1, password2) == 0)
        printf("Password correctn");
    else
        printf("Blockedn");
    
    return 0;
}

(e) Write a Pascal program to classify a triangle.

program TriangleType;
var
  a, b, c: integer;
begin
  write('Enter three sides of the triangle: ');
  readln(a, b, c);
  
  if (a = b) and (b = c) then
    writeln('Equilateral')
  else if (a = b) or (b = c) or (a = c) then
    writeln('Isosceles')
  else
    writeln('Scalene');
end.

(f) Write the names of the inventors of the following programming languages:
(i) C – Dennis Ritchie
(ii) Pascal – Niklaus Wirth


(g) Differentiate between formal and actual parameters in programming.

  • Formal parameter – Defined in the function declaration.
  • Actual parameter – The value passed when calling the function.

Example:

void greet(char name[]) {  // Formal parameter
    printf("Hello, %s!", name);
}
int main() {
    greet("John");  // Actual parameter
    return 0;
}

(h) Write a Pascal program to compute the total cost of items based on price and quantity.

program TotalCostCalculator;
var
  price, quantity, total: integer;
begin
  write('Enter price (10-100): ');
  readln(price);
  write('Enter quantity (less than 10): ');
  readln(quantity);

  if (price >= 10) and (price <= 100) and (quantity < 10) then
  begin
    total := price * quantity;
    writeln('Total cost: ', total);
  end
  else
    writeln('Invalid input.');
end.

(i) Explain two roles of documentation in programming.

  1. Improves maintainability – Helps future developers understand the code.
  2. Facilitates debugging – Provides explanations for complex logic.

(j) Differentiate between random and sequential file organization.

  • Random file organization – Data is accessed directly using an index (e.g., database files).
  • Sequential file organization – Data is stored and accessed in order (e.g., text files).

(k) Write a Pascal program to calculate the average of five values entered by a user.

program AverageCalculator;
var
  numbers: array[1..5] of integer;
  sum, i: integer;
  avg: real;
begin
  sum := 0;
  
  for i := 1 to 5 do
  begin
    write('Enter number ', i, ': ');
    readln(numbers[i]);
    sum := sum + numbers[i];
  end;
  
  avg := sum / 5;
  writeln('Average: ', avg:0:2);
end.

 


Question 1

(a) Outline four programming paradigms shift in order of occurrence.

  1. Machine Language – Writing programs using binary code.
  2. Assembly Language – Using symbolic names instead of binary (e.g., MOV, ADD).
  3. Procedural Programming – Using structured programming (e.g., C, Pascal).
  4. Object-Oriented Programming (OOP) – Using objects and classes (e.g., Java, Python).

(b) Explain the following terms as used in programming:

(i) Iteration – The repetition of a block of code using loops (for, while).
Example:

for (int i = 0; i < 5; i++) {
    printf("Hellon");
}

(ii) Breakpoint – A debugging tool that stops execution at a specific line for inspection.


(c) Describe three necessary requirements of an Integrated Development Environment (IDE) for C programming.

  1. Code Editor – Allows writing and modifying code.
  2. Compiler – Translates C code into machine language.
  3. Debugger – Helps find and fix errors in the code.

Question 2

(a) State three Boolean operators used in programming.

  1. AND (&&) – Returns true if both conditions are true.
  2. OR (||) – Returns true if at least one condition is true.
  3. NOT (!) – Negates a condition.

(b) Describe two parameter passing mechanisms in programming.

  1. Pass by Value – A copy of the argument is passed.
  2. Pass by Reference – The actual memory address of the argument is passed.

Example:

void addTen(int *num) {
    *num += 10;  // Modifies the original value
}

(c) Classify the following Pascal names as either identifier or keyword:

Name Type
label Keyword
new Keyword
number Identifier
type Keyword

(d) Distinguish between enumerated and sub-range data types in Pascal.

  • Enumerated Data Type – Defines a list of values.
    type Colors = (Red, Green, Blue);
    
  • Sub-range Data Type – Defines a range within an existing type.
    type Age = 1..100;
    

Question 3

(a) Outline four limitations of using pointers in programming.

  1. Complexity – Pointers make code harder to understand.
  2. Memory Leaks – Improper use can cause memory leaks.
  3. Security Risks – Can be exploited to access unauthorized memory.
  4. Debugging Issues – Harder to debug compared to normal variables.

(b) Explain the term argument as used in programming.

An argument is a value passed to a function when it is called.
Example:

void greet(char name[]) {
    printf("Hello, %s!", name);
}
greet("John"); // "John" is an argument

(c) Distinguish between linear and nonlinear data structures.

Type Definition Example
Linear Data is arranged sequentially. Arrays, Linked Lists
Nonlinear Data is arranged in a hierarchical manner. Trees, Graphs

Example of a linear array in C:

int numbers[] = {1, 2, 3, 4, 5};

Example of a nonlinear tree in C:

struct Node {
    int data;
    struct Node* left;
    struct Node* right;
};

(d) Evaluate the expression: 4*9/(16-2)+4;

Step-by-step calculation:

  1. 16 - 2 = 14
  2. 4 * 9 = 36
  3. 36 / 14 ≈ 2.57
  4. 2.57 + 4 = 6.57

Final output: 6.57


Question 5

(a) Define the term objects in database management systems.

Objects in DBMS refer to database elements like tables, queries, forms, and reports.


(b) State two examples of keys used to enforce data integrity.

  1. Primary Key – Uniquely identifies a record.
  2. Foreign Key – Establishes a relationship between two tables.

Question 6

(a) Explain the following features in a Desktop Publishing (DTP) program:

(i) Grids – A set of horizontal and vertical lines to align content.
(ii) Typography – The arrangement and design of text, including fonts, sizes, and spacing.


(b) Distinguish between single-field and multiple-field queries in databases.

Query Type Definition Example
Single-field Searches in one field. SELECT * FROM Students WHERE Age > 18;
Multiple-field Searches in multiple fields. SELECT * FROM Students WHERE Age > 18 AND Gender = 'Male';

(c) Explain the function of conditional formatting in spreadsheets.

Conditional formatting highlights cells based on conditions, e.g., making negative numbers red.

Example in Excel:

  • Condition: If value < 0, color red

(d) Function to count trainees in ICT department in a spreadsheet.

In Excel:

=COUNTIF(B:B, "ICT")

(e) Outline two reasons for using different fonts in a publication.

  1. Visual appeal – Makes documents more attractive.
  2. Emphasis – Differentiates headings from body text.

 


Question 7

(a) State two return types for the main function in C programming.

  1. int – Returns an integer value, typically 0 for successful execution.
  2. void – Does not return any value.

Example:

int main() { return 0; }  // Using int return type
void main() { /* No return value */ }  // Using void return type (not recommended)

(b) Distinguish between compatibility and interoperability as used in programming.

Term Definition
Compatibility The ability of software to run on different systems without modification.
Interoperability The ability of different systems to communicate and work together.

Example:

  • Compatibility: A Windows program running on both Windows 10 and Windows 11.
  • Interoperability: A Java application communicating with a C++ application using an API.

(c) Pascal program to store five values in an array:

program ArrayExample;
var
  numbers: array[1..4] of integer;
begin
  numbers[1] := 2;
  numbers[2] := 4;
  numbers[3] := 5;
  numbers[4] := 6;
end.

(d) Three types of errors in programming.

  1. Syntax Error – Caused by incorrect code structure (e.g., missing semicolon).
  2. Runtime Error – Occurs during program execution (e.g., division by zero).
  3. Logical Error – Produces incorrect results without crashing (e.g., wrong formula).

(e) C program to determine generation from year of birth:

#include <stdio.h>

int main() {
    int year;
    printf("Enter year of birth: ");
    scanf("%d", &year);

    if (year >= 1946 && year <= 1964)
        printf("Baby Boomern");
    else if (year >= 1965 && year <= 1980)
        printf("Generation Xn");
    else if (year >= 1981 && year <= 1996)
        printf("Millennialn");
    else if (year >= 1997 && year <= 2012)
        printf("Generation Zn");
    else
        printf("Generation Alphan");

    return 0;
}

(f) Describe two pre-processor directives in C programming.

  1. #include – Includes libraries (e.g., #include <stdio.h>).
  2. #define – Defines constants (#define PI 3.14).

(g) Explain two circumstances in which a stack data structure is used.

  1. Undo/Redo Functionality – Used in applications like text editors.
  2. Function Call Stack – Stores function calls in recursion.

(h) Difference between append and close in Pascal file handling.

  • append – Opens a file and adds new content at the end.
  • close – Closes the file after reading or writing.

Example:

assign(f, 'data.txt');
append(f);
writeln(f, 'New data');
close(f);

(i) Construct a binary search tree for nodes: 47, 25, 6, 27, 80, 52, 15, 94.

Tree Structure:

       47
      /   
    25     80
   /      /  
  6   27  52  94
   
   15

(ii) Depth of node 15:

Depth = 2 (Root → 6 → 15).


(iii) Post-order traversal output:

15, 6, 27, 25, 52, 94, 80, 47

 


Question 1

(a) Outline four programming paradigms shift in order of occurrence.

  1. Imperative Programming – Focuses on step-by-step instructions (e.g., C, Pascal).
  2. Procedural Programming – Uses functions and procedures to structure code (e.g., C, Fortran).
  3. Object-Oriented Programming (OOP) – Uses objects and classes (e.g., Java, C++).
  4. Functional Programming – Treats functions as first-class citizens (e.g., Lisp, Haskell).

(b) Explain the following programming terms:

(i) Iteration

  • The repetition of a block of code using loops (e.g., for, while).

Example (C):

for (int i = 0; i < 5; i++) {
    printf("Iteration %dn", i);
}

(ii) Breakpoint

  • A debugging tool that pauses program execution at a specific line.

(c) Three necessary requirements of an Integrated Development Environment (IDE) for C programming.

  1. Text Editor – For writing and editing code.
  2. Compiler – Translates C code into machine code.
  3. Debugger – Identifies and fixes errors in the code.

(d) Pascal program to compute and output the volume of a cuboid.

program CuboidVolume;
var
  length, width, height, volume: integer;

procedure ComputeVolume(l, w, h: integer);
begin
  volume := l * w * h;
  writeln('Volume of cuboid: ', volume);
end;

begin
  write('Enter length: '); readln(length);
  write('Enter width: '); readln(width);
  write('Enter height: '); readln(height);
  ComputeVolume(length, width, height);
end.

Question 2

(a) Three Boolean operators used in programming.

  1. AND (&&) – Returns true if both conditions are true.
  2. OR (||) – Returns true if at least one condition is true.
  3. NOT (!) – Inverts a boolean value.

Example (C):

if (x > 5 && y < 10) { printf("Both conditions are true."); }

(b) Two parameter passing mechanisms in programming.

Mechanism Description
Pass by Value A copy of the variable is passed to the function.
Pass by Reference The actual memory address is passed, allowing modification.

Example (C):

void byValue(int a) { a = 10; }  // Does not change original value
void byReference(int *a) { *a = 10; }  // Modifies original value

(c) Classify Pascal names as Identifier or Keyword.

Name Type
label Keyword
new Keyword
number Identifier
type Keyword

(d) Difference between enumerated and sub-range data types in Pascal.

Data Type Description
Enumerated A user-defined data type with a fixed set of values (e.g., type Colors = (Red, Green, Blue);).
Sub-range Defines a range within an existing data type (e.g., var age: 18..30;).

Question 3

(a) Four limitations of using pointers in programming.

  1. Complexity – Increases program difficulty.
  2. Memory Leaks – Poor pointer handling can cause memory issues.
  3. Security Risks – Pointers can be exploited in attacks.
  4. Null Pointer Dereferencing – Accessing an invalid pointer leads to crashes.

(b) Definition of an argument in programming.

  • A value passed to a function when calling it.

Example (C):

void greet(char name[]) { printf("Hello, %s!", name); }

Here, name is an argument when calling greet("Alice").


(c) Difference between linear and nonlinear data structures.

Type Description Example
Linear Data is arranged in a sequence. Array, Linked List
Nonlinear Data is connected in a hierarchical manner. Tree, Graph

(d) Evaluate the C expression:

4 * 9 / (16 - 2) + 4;

Step-by-step:

  1. 16 - 2 = 14
  2. 4 * 9 = 36
  3. 36 / 14 = 2 (Integer division)
  4. 2 + 4 = 6

Final Output: 6


Question 4

(a) Pascal program to compute square root using a function.

program SquareRoot;
uses math;
var num: real;

function ComputeSqrt(x: real): real;
begin
  ComputeSqrt := sqrt(x);
end;

begin
  write('Enter number: '); readln(num);
  writeln('Square root: ', ComputeSqrt(num):0:2);
end.

(b) Program development cycle stages:

  1. Design – Planning program logic.
  2. Coding – Writing the actual program code.

(c) Difference between unary and binary operators in C.

Operator Type Definition Example
Unary Works on one operand. x = -5; (Negation)
Binary Works on two operands. x = a + b; (Addition)

(d) C program for password validation.

#include <stdio.h>
#include <string.h>

int main() {
    char pass1[20], pass2[20];
    printf("Enter password: ");
    scanf("%s", pass1);
    printf("Re-enter password: ");
    scanf("%s", pass2);

    if (strcmp(pass1, pass2) == 0)
        printf("Password correctn");
    else
        printf("Blockedn");

    return 0;
}

(e) Pascal program to classify a triangle.

program TriangleType;
var a, b, c: integer;
begin
  write('Enter three sides: ');
  readln(a, b, c);

  if (a = b) and (b = c) then
    writeln('Equilateral')
  else if (a = b) or (b = c) or (a = c) then
    writeln('Isosceles')
  else
    writeln('Right Angled');
end.

(f) Name the inventors of the following programming languages:

  1. C – Dennis Ritchie
  2. Pascal – Niklaus Wirth

(g) Difference between formal and actual parameters.

Parameter Type Description Example
Formal Defined in function declaration. void add(int x, int y)
Actual Passed when calling the function. add(5, 10);

(h) Pascal program to calculate the average of five values.

program AverageCalc;
var i, sum, num: integer;
begin
  sum := 0;
  for i := 1 to 5 do
  begin
    write('Enter number: ');
    readln(num);
    sum := sum + num;
  end;
  writeln('Average: ', sum / 5:0:2);
end.

Question 1:

(a) Differentiate between RAM and cache memory.

Answer: RAM (Random Access Memory) is the main memory of a computer where data and programs that are currently being used are stored. Cache memory, on the other hand, is a smaller, faster type of memory that stores frequently accessed data to speed up processing.

(b) Define the following terms as used in file management: (i) Fields; (ii) Record.

Answer: A field is the smallest unit of data that represents a single attribute of an entity. A record is a collection of related fields that represent a complete entity.

(c) User should be assigned different access rights to ensure file integrity. Outline four examples of access rights that could be assigned to a user in a networked environment.

Answer:

  1. Read – Allows the user to view file contents.

  2. Write – Allows the user to modify file contents.

  3. Execute – Allows the user to run executable files.

  4. Delete – Allows the user to remove files from storage.

(d) (i) Concurrency control is very important in process management in operating systems. Explain two motivations for allowing concurrent executions in computers.

Answer:

  1. Increased Efficiency: Concurrent execution allows multiple tasks to be processed simultaneously, improving overall system performance.

  2. Resource Utilization: Enables better use of system resources such as CPU and memory by allowing multiple processes to share them efficiently.

(ii) Noel intends to install an operating system in a new hard disk to replace an existing faulty one. Describe three activities that she would carry out on the disk before the installation of the OS.

Answer:

  1. Partitioning the Disk: Dividing the disk into sections to organize files and system data.

  2. Formatting: Preparing the disk with a file system suitable for the OS.

  3. Boot Sector Setup: Ensuring the disk has a proper boot sector to allow the system to start up correctly.


Question 2:

(a) (i) Outline two types of operating systems based on the number of jobs.

Answer:

  1. Single-tasking OS: Can run only one program at a time.

  2. Multi-tasking OS: Allows multiple programs to run simultaneously.

(ii) Outline two objectives of operating systems in computers.

Answer:

  1. Resource Management: Efficiently manages system resources such as CPU, memory, and storage.

  2. User Interface Provision: Provides an interface for users to interact with the computer system.

(b) The operating system controls the execution of processes. Explain four reasons that could necessitate the suspension of a running process.

Answer:

  1. I/O Operation: The process may need to wait for input or output operations to complete.

  2. Higher Priority Process: Another process with higher priority needs the CPU.

  3. Memory Limitations: The process may require more memory than is available.

  4. User Intervention: The user may pause or stop the process manually.

(c) With the aid of a cross-sectional diagram, outline the organization of a disk.

Answer: A disk is organized into platters, tracks, sectors, and clusters. The data is stored magnetically on rotating platters divided into concentric circles called tracks. Each track is further divided into sectors, which are the smallest data storage units.

(d) (i) Outline two file attributes.

Answer:

  1. File Name: The identifier for the file.

  2. File Size: The amount of space the file occupies.

(ii) Differentiate between indexed and next-fit algorithms as used in memory management.

Answer:

  • Indexed Allocation: Uses an index table to keep track of all file blocks, allowing efficient access.

  • Next-fit Allocation: Allocates memory to the next available block that fits the process’s needs, reducing fragmentation.

(e) The operating system must allocate and deallocate various resources for each active process. Describe three of these resources.

Answer:

  1. CPU Time: Allocates processor time for execution.

  2. Memory: Allocates RAM space required for process execution.

  3. I/O Devices: Assigns devices like printers and disk drives to processes as needed.

(f) Table 1 shows execution information of four processes in a system. Use it to answer the questions that follow.

(i) Assuming SJF scheduling algorithm, evaluate:

  • The average waiting time for the processes.

  • The average turnaround time for the system.

Answer: The Shortest Job First (SJF) scheduling algorithm prioritizes the shortest jobs first, leading to minimal waiting time. The waiting and turnaround times depend on the specific job durations.

 

Question 3:

(a) Explain the following terms as used in process management: (i) Spawning; (ii) Thread.

Answer:

  1. Spawning: The process of creating a new child process from a parent process.

  2. Thread: The smallest unit of execution within a process that shares the process’s resources.

(b) Outline four typical process object attributes during or after execution.

Answer:

  1. Process ID: Unique identifier assigned to each process.

  2. Process State: Current status (e.g., running, waiting, terminated).

  3. CPU Registers: Stores temporary data and instructions.

  4. Memory Allocation: Defines memory usage by the process.

(c) Differentiate between logical I/O and device I/O as used in I/O management.

Answer:

  • Logical I/O: Manages user-level data operations without concern for hardware specifics.

  • Device I/O: Handles the actual hardware-level communication between devices and the system.

(d) Operating systems play a critical role in memory management. Explain four requirements that the memory management design of an operating system should endeavor to satisfy.

Answer:

  1. Protection: Prevents one process from accessing another’s memory.

  2. Relocation: Allows dynamic movement of processes in memory.

  3. Allocation: Efficiently assigns memory to processes.

  4. Sharing: Enables multiple processes to access shared memory safely.