COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY

TOPIC 7 | REVISION CARDS

Topics from the Cambridge IGCSE (9-1) Computer Science 0984 syllabus 2023 - 2025
Picture

GCSE TOPIC 7 | REVISION CARDS

WHAT IS AN ALGORITHM?
An algorithm is a step-by-step procedure or formula for solving a problem. It's a finite set of instructions that, if followed, accomplishes a particular task. In computing, algorithms are used to manipulate data, make calculations, and automate reasoning.
WHY IS PSEUDOCODE USED IN ALGORITHM DESIGN?
Pseudocode is used in algorithm design to represent the steps and logic of an algorithm in a human-readable form that is independent of programming languages. It simplifies the process of explaining and designing algorithms by focusing on the algorithm's structure without getting bogged down by syntax details.
DEFINE A DATA STRUCTURE AND GIVE EXAMPLES.
A data structure is a specialized format for organizing, processing, retrieving, and storing data. Examples include arrays, linked lists, stacks, queues, trees, and graphs. Each structure has its own strengths and weaknesses in terms of access speed, data storage, and efficiency.
EXPLAIN THE CONCEPT OF PROCEDURAL PROGRAMMING.
Procedural programming is a programming paradigm based on the concept of procedure calls, where a program is divided into a set of functions. It focuses on a sequence of executable statements that change the program's state, leading to a desired outcome.
WHY IS ALGORITHM EFFICIENCY IMPORTANT?
Algorithm efficiency is crucial because it directly impacts the performance and scalability of software applications. Efficient algorithms can handle larger data sets, perform faster, and require fewer resources, which is essential in real-world applications where time and resources are limited.
WHAT IS A BUBBLE SORT ALGORITHM?
A bubble sort algorithm is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted. It is known for its simplicity but is inefficient on large lists.
​DESCRIBE THE BINARY SEARCH ALGORITHM.
Binary search is an efficient algorithm for finding an item from a sorted list of items. It works by repeatedly dividing in half the portion of the list that could contain the item, until narrowing down the possible locations to just one. It is much faster than a linear search except on small lists.
WHAT ARE THE STAGES OF THE PROGRAM DEVELOPMENT LIFE CYCLE?
The stages include analysis (identifying problems and requirements), design (creating structure diagrams, flowcharts, pseudocode), coding (writing program code and iterative testing), and testing (using test data to validate the code).
HOW CAN A PROBLEM BE DECOMPOSED INTO COMPONENT PARTS?
A problem can be broken down into sub-systems and further into component parts using abstraction and decomposition techniques. This approach helps in managing complexity and designing solutions.
WHAT IS THE PURPOSE OF AN ALGORITHM?
The purpose of an algorithm is to outline a sequence of steps to solve a specific problem or perform a computation. Algorithms are fundamental in developing logical solutions and programming.
DESCRIBE THE LINEAR SEARCH ALGORITHM.
Linear search checks each item in a list sequentially until the target value is found or the list ends. It's simple but can be inefficient on large datasets.
WHAT ARE VALIDATION CHECKS AND WHY ARE THEY NEEDED?
Validation checks ensure data integrity by verifying that input data is sensible, reasonable, and within allowed limits. Types include range, length, type, presence, and format checks.
WHAT IS THE DIFFERENCE BETWEEN VALIDATION AND VERIFICATION CHECKS?
Verification checks confirm that data was correctly transferred or entered, such as through double entry or visual checks, while validation checks ensure the data meets specific criteria and is sensible.
WHAT ARE THE TYPES OF TEST DATA?
Types include normal (typical data), abnormal (data that falls outside normal boundaries), extreme (data at the boundary of what is acceptable), and boundary (data just inside and outside boundaries).
WHAT IS A TRACE TABLE USED FOR IN ALGORITHMIC DESIGN?
Trace tables document each step of an algorithm's execution, tracking variables, outputs, and decisions to help understand and debug the algorithm.
HOW CAN ERRORS IN ALGORITHMS BE IDENTIFIED AND CORRECTED?
Errors can be identified through testing and analysis, including trace tables. Corrections involve revising the logic, ensuring correct data types and operations are used, and retesting.
WHY IS PSEUDOCODE USED IN ALGORITHM DESIGN?
Pseudocode is used for its simplicity and clarity, allowing designers to focus on the algorithm's logic without worrying about syntax specifics of programming languages.
HOW IS TOTALLING IMPLEMENTED IN ALGORITHMS?
Totalling involves accumulating a sum or total from a series of values, typically using a loop to iterate over data and update a total variable accordingly.

FOR EXAMPLE
DECLARE total: INTEGER ← 0
DECLARE numbers: ARRAY[1:5] OF INTEGER ← [2, 5, 7, 1, 4]
FOR i ← 1 TO 5
    total ← total + numbers[i]
ENDFOR
OUTPUT total

DESCRIBE THE COUNTING PROCESS IN ALGORITHMS.
Counting in algorithms involves incrementing a counter variable each time a certain condition is met within a data set, often implemented within a loop structure.

FOR EXAMPLE

DECLARE count: INTEGER ← 0
DECLARE numbers: ARRAY[1:5] OF INTEGER ← [2, 5, 7, 1, 4]
FOR i ← 1 TO 5
    IF numbers[i] > 3 THEN
        count ← count + 1
    ENDIF
ENDFOR
OUTPUT count​
HOW IS THE MAXIMUM VALUE DETERMINED IN A DATA SET USING ALGORITHMS?
To find the maximum value, iterate through the data set, comparing each value with the current maximum, and update the maximum if a larger value is found.

FOR EXAMPLE
DECLARE maxValue: INTEGER ← -9999
DECLARE numbers: ARRAY[1:5] OF INTEGER ← [2, 5, 7, 1, 4]
FOR i ← 1 TO 5
    IF numbers[i] > maxValue THEN
        maxValue ← numbers[i]
    ENDIF
ENDFOR
OUTPUT maxValue

WHAT IS THE PROCESS FOR FINDING THE MINIMUM VALUE IN A SET OF DATA ALGORITHMICALLY?
Similar to finding the maximum, iterate through the data set, but compare each value against the current minimum, updating it if a smaller value is encountered.

FOR EXAMPLE

DECLARE minValue: INTEGER ← 9999
DECLARE numbers: ARRAY[1:5] OF INTEGER ← [2, 5, 7, 1, 4]
FOR i ← 1 TO 5
    IF numbers[i] < minValue THEN
        minValue ← numbers[i]
    ENDIF
ENDFOR
OUTPUT minValue​
HOW ARE AVERAGE VALUES CALCULATED IN ALGORITHMS? 
To calculate an average, sum all values and divide by the count of values.

FOR EXAMPLE
DECLARE total: INTEGER ← 0
DECLARE average: REAL
DECLARE numbers: ARRAY[1:5] OF INTEGER ← [2, 5, 7, 1, 4]
FOR i ← 1 TO 5
    total ← total + numbers[i]
ENDFOR
average ← total / 5
OUTPUT average​
WHAT IS ITERATION IN ALGORITHMS? PROVIDE AN EXAMPLE IN PSEUDOCODE.
Iteration in algorithms refers to the repetition of a block of statements within a computer program.

EXAMPLE
FOR i ← 1 TO 10
    OUTPUT i
ENDFOR

EXPLAIN SELECTION IN ALGORITHMS WITH AN EXAMPLE IN PSEUDOCODE.
Selection in algorithms involves choosing between two or more paths based on conditions.

​EXAMPLE

IF grade >= 50 THEN
    OUTPUT "Pass"
ELSE
    OUTPUT "Fail"
ENDIF​
DESCRIBE THE CONCEPT OF SEQUENCE IN ALGORITHM DESIGN.
A sequence in algorithm design is an ordered set of instructions that follow one after another.
HOW ARE FUNCTIONS USED IN ALGORITHMS? GIVE AN EXAMPLE IN PSEUDOCODE.
Functions in algorithms encapsulate a block of code that performs a specific task and can be reused.

EXAMPLE

FUNCTION Add(a: INTEGER, b: INTEGER) RETURNS INTEGER
    RETURN a + b
ENDFUNCTION

DECLARE result: INTEGER
result ← Add(5, 3)
OUTPUT result​
DESCRIBE A COMMON DEBUGGING TECHNIQUE.
A common debugging technique involves using print statements to track the execution flow and variable values at various points in a program, helping to identify where things go wrong.
WHAT IS COMPLEX PROBLEM DECOMPOSITION?
Complex problem decomposition involves breaking down a large and complex problem into smaller, more manageable problems or tasks.
Example: Designing a website can be decomposed into creating a layout, writing content, and developing features like forms and galleries.
EXPLAIN DATA VALIDATION TECHNIQUES IN ALGORITHMS. PROVIDE AN EXAMPLE.
 Data validation techniques ensure input data is sensible and within acceptable parameters. Common techniques include range checking, length checking, and type checking.

EXAMPLE
​IF age < 0 OR age > 120 THEN
    OUTPUT "Invalid age. Please enter a value between 0 and 120."
ENDIF


​HOW ARE ARRAYS UTILIZED IN ALGORITHMS? PROVIDE AN EXAMPLE.
Arrays store multiple values in a single variable, accessible by indices, making them useful for storing data collections.

EXAMPLE
​DECLARE scores: ARRAY[1:5] OF INTEGER ← [88, 76, 90, 61, 69]
total ← 0
FOR i FROM 1 TO 5
    total ← total + scores[i]
ENDFOR
average ← total / 5
OUTPUT "Average score: ", average

WHAT IS THE BASIC PRINCIPLE OF THE BUBBLE SORT ALGORITHM?
The basic principle of the Bubble Sort algorithm involves repeatedly stepping through the list to be sorted, comparing adjacent elements and swapping them if they are in the wrong order. The process is repeated until no swaps are needed, which means the list is sorted. It's named for the way smaller elements "bubble" to the top of the list (beginning) as the sorting progresses.
DISCUSS THE EFFICIENCY OF BUBBLE SORT. PROVIDE AN EXAMPLE WHERE IT MIGHT BE PRACTICAL.
Bubble Sort is known for its simplicity but is inefficient for large datasets due to its quadratic time complexity (O(n^2)). However, it can be practical for small arrays or when the data is nearly sorted because in such cases, it can approach linear time complexity. Additionally, Bubble Sort's algorithmic simplicity makes it useful for educational purposes, to illustrate basic sorting concepts.
IN WORDS, DESCRIBE THE PROCESS OF A BUBBLE SORT ALGORITHM.
The Bubble Sort algorithm sorts a list by repeatedly stepping through the list, comparing each pair of adjacent items, and swapping them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, indicating that the list is sorted. Initially, the largest unsorted element "bubbles up" to its correct position at the end of the list after each pass. This process continues, with each subsequent pass needing to examine one less element, as the end of the list becomes sorted. Despite its simplicity and intuitive process, Bubble Sort is not suited for large lists due to its inefficiency compared to more advanced sorting algorithms.
IN PSEUDOCODE, CREATE A BUBBLE SORT ALGORITHM.
FUNCTION BubbleSort(arr: ARRAY OF INTEGER)
    DECLARE n: INTEGER
    DECLARE i: INTEGER
    DECLARE swapped: BOOLEAN
    n ← LENGTH(arr)
    REPEAT
        swapped ← FALSE
        FOR i FROM 1 TO n-1
            IF arr[i] > arr[i + 1] THEN
                // Swap the elements
                DECLARE temp: INTEGER
                temp ← arr[i]
                arr[i] ← arr[i + 1]
                arr[i + 1] ← temp
                swapped ← TRUE
            ENDIF
        ENDFOR
        // Each iteration ensures the largest element bubbles up to the correct position
        n ← n - 1
    UNTIL NOT swapped
ENDFUNCTION
WHAT IS A RANGE CHECK AND HOW IS IT IMPLEMENTED IN DATA VALIDATION? ​
A range check ensures that a numerical value falls within a specific range. It's used to validate that data is within acceptable parameters.

EXAMPLE
IF (age >= 18 AND age <= 65) THEN
    OUTPUT "Age is within the acceptable range."
ELSE
    OUTPUT "Age is outside the acceptable range."
ENDIF

EXPLAIN A LENGTH CHECK IN THE CONTEXT OF DATA VALIDATION. ​
A length check verifies that the input data string meets a specific length requirement, ensuring data consistency.

EXAMPLE

IF LENGTH(password) >= 8 THEN
    OUTPUT "Password length is acceptable."
ELSE
    OUTPUT "Password must be at least 8 characters long."
ENDIF​
WHAT IS A TYPE CHECK IN DATA VALIDATION?
A type check ensures that the data entered matches the expected data type, such as integer, string, or boolean.

EXAMPLE
IF TYPEOF(userInput) = INTEGER THEN
    OUTPUT "Input type is correct."
ELSE
    OUTPUT "Input must be an integer."
ENDIF

​DESCRIBE A PRESENCE CHECK IN DATA VALIDATION.
A presence check verifies that a field has not been left blank, ensuring that required data is entered.

EXAMPLE
IF username <> "" THEN
    OUTPUT "Username entered."
ELSE
    OUTPUT "Username is required."
ENDIF​
WHAT IS A FORMAT CHECK IN DATA VALIDATION? 
A format check validates that the data is in a specific format, such as a date or email address pattern.

EXAMPLE 
IF MATCHES(email, "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$") THEN
    OUTPUT "Email format is valid."
ELSE
    OUTPUT "Invalid email format."
ENDI
F
​EXPLAIN THE PURPOSE OF A CHECK DIGIT IN DATA VALIDATION.
A check digit is an additional digit added to a number (like a barcode or account number) that verifies the integrity of the data against errors.

EXAMPLE
FUNCTION ValidateCheckDigit(number: STRING) RETURNS BOOLEAN
    DECLARE sum: INTEGER ← 0
    FOR i FROM 1 TO LENGTH(number)-1
        sum ← sum + INTEGER(number[i])
    ENDFOR
    DECLARE checkDigit: INTEGER ← sum MOD 10
    IF checkDigit = INTEGER(number[LENGTH(number)]) THEN
        RETURN TRUE
    ELSE
        RETURN FALSE
    ENDIF
ENDFUNCTION​
WHAT IS A NORMAL DATA TEST IN SOFTWARE TESTING?
A normal data test involves inputting data that is expected to be processed successfully by the system under normal conditions. It checks for standard operations and outcomes.
Example: For a calculator program, entering 2 + 2 to check if the output is 4 tests normal operation.
DESCRIBE AN ABNORMAL DATA TEST AND GIVE AN EXAMPLE.
An abnormal data test, also known as an error path test, inputs data that the program should not accept, to ensure it handles errors gracefully without crashing.
Example: Entering letters abc into a field that expects an age in numbers to ensure the program prompts for correct input type without error.
WHAT IS AN EXTREME DATA TEST?
Extreme data testing involves inputting values at the extreme ends of what is acceptable to ensure the system can handle edge cases.
Example: If a text field accepts a maximum of 50 characters, entering a 50-character string tests the system's handling of maximum length inputs.
EXPLAIN BOUNDARY DATA TESTING WITH AN EXAMPLE.
Boundary data testing checks the system's response to data values at or just outside the limits of what it is designed to handle, to identify any boundary-related errors.
Example: For a program that accepts ages from 1 to 100, testing with values 0 (just below the boundary), 1 (lower boundary), 100 (upper boundary), and 101 (just above the boundary) to ensure it accurately enforces limits.
WHY IS IT IMPORTANT TO TEST SOFTWARE WITH VARIOUS DATA TYPES?
Testing software with various data types ensures it behaves as expected under different conditions, improving reliability, user experience, and security by identifying and correcting potential issues across a range of inputs.
Picture
ALSO IN THIS TOPIC
​
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.