IGCSE Computer Science Paper 2 Notes by YMW Learning Hub
IGCSE Computer Science Paper 2 Notes by YMW Learning Hub
part of the software development process. It clearly defines what the system should do, which
helps in planning, designing, and developing the system efficiently.
The Student Registration Program will allow a school to manage student enrollments efficiently.
This program will enable administrators to register students, update their information, view
student records, and delete student profiles if needed.
2. Functional Requirements
3. Non-Functional Requirements
• Usability: The system should have an intuitive user interface that is easy to
navigate for school staff with basic computer skills.
• Performance: The system should be able to handle up to 10,000 student records
efficiently.
• Security: The system should require a password login to access student data and
ensure that sensitive information is kept secure.
• Scalability: The system should be able to expand to handle additional features in
the future, such as student grades and attendance tracking.
4. Input Requirements
5. Output Requirements
6. Constraints
7. Assumptions
This detailed requirement specification ensures that developers understand the exact needs of
the school, allowing them to build a system that meets these expectations. It’s also a good
reference for your students to learn about the importance of clarity and detail when designing a
software solution.
When teaching IGCSE Computer Science Chapter 7 on algorithm design and problem solving,
the concepts of abstraction and decomposition are fundamental. Here’s how you can explain
these concepts with examples to help your students understand:
1. Abstraction
Definition: Abstraction involves simplifying a complex problem by focusing on the essential
details while ignoring the irrelevant ones. The goal is to reduce complexity and make the
problem easier to solve.
Explanation:
• When we use abstraction, we ignore unnecessary details and only focus on
what’s needed to solve a problem.
• Think of it like creating a map: A map only shows roads, landmarks, and other
essential features, leaving out details like trees, buildings, or people. This makes the map easier
to use for navigation.
Example:
Imagine you’re designing a program to manage a school library system. Here’s how abstraction
can be applied:
• Step 1: Identify the important details needed to manage the library: book titles,
authors, availability, and student borrowing records.
• Step 2: Ignore unnecessary details like the color of the book covers or the type of
paper used for the pages.
• Result: By focusing only on the key details (like book ID, title, author, and student
ID), the problem becomes simpler to solve.
class Book:
def __init__(self, title, author, available=True):
self.title = title
self.author = author
self.available = available
In this example, we abstract the concept of a book to just three attributes (title, author,
available). We do not include details like the book’s dimensions or publisher, which are
irrelevant to solving the problem.
2. Decomposition
Definition: Decomposition involves breaking down a complex problem into smaller, more
manageable parts. Each part can then be solved individually, making it easier to tackle the
overall problem.
Explanation:
• Think of decomposition like breaking a large task into smaller steps, like
preparing a meal. Instead of trying to cook everything at once, you break it down into tasks like
washing vegetables, cutting ingredients, and cooking each dish separately.
• It helps in making the problem-solving process more efficient and easier to
debug.
Example:
Let’s say you’re writing a program to calculate the average score of students in a class. Instead
of trying to write one big program, you can decompose it into smaller tasks:
• Step 1: Get input of students’ scores.
• Step 2: Calculate the total of all scores.
• Step 3: Calculate the average score.
• Step 4: Display the result.
def get_scores():
scores = [90, 85, 78, 92, 88]
return scores
def calculate_total(scores):
return sum(scores)
def display_result(average):
print(f"The average score is {average:.2f}")
scores = get_scores()
total = calculate_total(scores)
average = calculate_average(total, len(scores))
display_result(average)
Here, the problem is broken into four functions. This makes the code easier to understand, test,
and maintain.
Summarizing Both Concepts
These explanations and examples should help your students understand the importance of
these concepts in algorithm design and problem-solving.
• Thinkwave offers a free, cloud-based student information system that allows for
student registration, attendance tracking, and grade management.
• You can create student profiles, manage classes, and generate reports, which
can demonstrate the core functionalities of a registration program.
• The free plan includes most of the basic features, making it a great tool for
educational demonstrations.
Website: Thinkwave
Website: OpenEduCat
• Airtable is a versatile online database tool that can be used to set up a student
registration system.
• With its free plan, you can create a database with custom fields for student
information (e.g., name, grade, contact details).
• It supports CRUD operations, so you can demonstrate adding, editing, searching,
and deleting student records.
Website: Airtable
• You can create a Student Registration Form using Google Forms, which
automatically saves the data to Google Sheets.
• This is a great free tool to demonstrate how to collect student data online and
manage it efficiently.
• You can use Google Sheets for basic CRUD operations: adding new entries,
updating records, searching, and deleting data.
Website: Schoology
Recommendations
If you are specifically looking for a simple, free, and quick solution for demonstrating student
registration functionality, I recommend trying:
• Google Forms + Google Sheets: Easy to set up, no installation needed, and
perfect for classroom demonstrations.
• Airtable: Great for interactive database management with an intuitive user
interface.
These tools are free and accessible, making them ideal for educational purposes. Let me know
2. Product Management
3. Inventory Management
4. Sales Processing
7. Supplier Management
8. Payment Integration
• Purpose: Integrates with various payment gateways for seamless transactions.
• Features:
• Support for credit/debit card processing.
• Integration with digital wallets (e.g., Apple Pay, Google Pay).
• Support for cash drawers and receipt printers.
• Handling online payments if the system supports e-commerce.
9. Employee Management
• Purpose: Integrates with online stores for unified sales and inventory
management.
• Features:
• Sync inventory and sales data between the POS and online store.
• Support for online orders, returns, and payments.
• Real-time updates on stock availability for online shoppers.
Module Summary
These modules can be tailored depending on the specific needs of the business using the POS
system. You can demonstrate these modules to students to help them understand how POS
systems are designed to optimize business operations.
Imagine you are testing a Student Registration System that stores student records and allows
you to retrieve them. Let’s say one of the functionalities you want to test is the ability to add a
new student and then retrieve that student’s information.
Scenario
• You know that after adding the student, the system should store and retrieve the
following information correctly:
• Since the output matches the expected outcome, the test passes.
What If It Fails?
If the system does not return the expected data (e.g., if the email is incorrect or the student
record is not found), it indicates a bug in the system. This could be due to:
• Incorrect implementation of the registration functionality.
• Issues with data storage or retrieval.
• Incorrect handling of user input.
Let’s say you are testing a simple calculator function that performs addition.
• Input: 5 + 3
• Expected Result: 8
If the output matches the expected result, the test passes. If the system returns 7 instead, you
know there is an issue with the addition functionality.
Testing with known data and expected outcomes is a fundamental part of software testing
because it ensures the correctness and reliability of the system under controlled conditions.
Pseudo code
Pseudocode is a way to describe the logic and steps of a computer program using plain,
human-readable language. It is not actual code but rather a simplified version of it, written in a
way that is easy to understand. The purpose of pseudocode is to outline the flow of a program
before writing the actual code in a specific programming language.
• Planning: Helps programmers think through the logic of their code before
implementation.
• Clarity: Makes it easier to explain algorithms to others, even if they are not
familiar with a specific programming language.
• Simplicity: Allows you to focus on the structure of the solution without worrying
about syntax.
IF score >= 50
PRINT "Pass"
ELSE
PRINT "Fail"
Here’s an example of pseudocode for adding two numbers and displaying the result:
START
INPUT number1
INPUT number2
SET sum = number1 + number2
PRINT sum
END
START
INPUT num1, num2, num3
IF num1 > num2 AND num1 > num3 THEN
PRINT "num1 is the largest"
ELSE IF num2 > num1 AND num2 > num3 THEN
PRINT "num2 is the largest"
ELSE
PRINT "num3 is the largest"
END
START
DISPLAY "Enter student name"
INPUT studentName
DISPLAY "Enter student ID"
INPUT studentID
DISPLAY "Enter student grade"
INPUT grade
STORE studentName, studentID, grade IN database
PRINT "Student registered successfully"
END
By using pseudocode, you can focus on solving the problem logically before diving into the
complexities of syntax and coding in a specific programming language.
No, there is no universally standardized format for pseudocode. However, there are common
conventions and best practices that programmers typically follow to ensure clarity and
readability. The primary goal of pseudocode is to communicate the logic and structure of an
algorithm in a simple, language-agnostic way. This flexibility means that the format can vary
depending on the context or the preferences of the team using it.
That said, there are some general guidelines to keep in mind to make your pseudocode
effective and understandable.
1. Use Plain English: Write the steps of your algorithm in plain language that is easy
to understand.
2. Use Common Programming Constructs: Use familiar programming structures like
IF, FOR, WHILE, ELSE, RETURN, etc.
3. Keep It Simple: Avoid complex syntax or unnecessary details. Focus on the logic
rather than specific coding syntax.
4. Indentation and Structure: Use proper indentation to show nested logic (like loops
and conditionals).
5. Consistent Naming: Use meaningful and consistent variable names to enhance
clarity.
6. Avoid Language-Specific Syntax: Do not use code that is specific to any
programming language (like curly braces {}, ;, etc.).
Below are examples showing how to write pseudocode using common constructs:
1. Conditional Statements
2. Loops
FOR each item IN shoppingList
PRINT item
END FOR
3. While Loop
SET count = 0
WHILE count < 10
PRINT count
SET count = count + 1
END WHILE
4. Procedures/Functions
Imagine you need to write pseudocode for a program that finds the largest number among three
inputs.
START
INPUT num1, num2, num3
IF num1 > num2 AND num1 > num3 THEN
PRINT "num1 is the largest"
ELSE IF num2 > num1 AND num2 > num3 THEN
PRINT "num2 is the largest"
ELSE
PRINT "num3 is the largest"
END IF
END
Some organizations or educational institutions might have their own preferred format for
pseudocode. Here are some variations:
Indented Style
Start
Input num1, num2, num3
If num1 > num2 and num1 > num3 then
Print "num1 is the largest"
Else if num2 > num1 and num2 > num3 then
Print "num2 is the largest"
Else
Print "num3 is the largest"
End If
End
For complex systems, using flowcharts alongside pseudocode can provide a visual
representation of the algorithm.
Summary
While there is no fixed format for pseudocode, adhering to the conventions and guidelines
above will help ensure your pseudocode is clear, easy to read, and serves its purpose as a
planning and communication tool.
Cambridge has a defined pseudocode style that students are expected to use in their exams.
The pseudocode is simple, structured, and resembles high-level programming languages, but it
is not language-specific.
total ← 0
name ← "John"
• Input/Output:
• Use INPUT for taking input from the user.
INPUT username
• Conditional Statements:
• Use IF, THEN, ELSE, and ENDIF.
• Loops:
• Use FOR, TO, NEXT for for loops.
FOR i ← 1 TO 10
OUTPUT i
NEXT i
REPEAT
INPUT password
UNTIL password = "1234"
• Procedures/Functions:
• Use PROCEDURE and FUNCTION with RETURN for functions.
FUNCTION addNumbers(a, b)
RETURN a + b
ENDFUNCTION
The Edexcel exam board also has its own pseudocode conventions, which are quite similar to
CIE but with a few differences.
total = 0
name = "Alice"
• Input/Output:
• Use INPUT or READ to get input from the user.
INPUT username
PRINT "Welcome"
• Conditional Statements:
• Use IF, THEN, ELSE, ENDIF.
IF age >= 18 THEN
PRINT "Adult"
ELSE
PRINT "Minor"
ENDIF
• Loops:
• Use FOR, NEXT for for loops.
FOR i = 1 TO 5
PRINT i
NEXT i
REPEAT
INPUT guess
UNTIL guess = secretNumber
• Procedures/Functions:
• Similar to CIE, PROCEDURE and FUNCTION can be used.
FUNCTION add(a, b)
RETURN a + b
ENDFUNCTION
By adhering to the standards set by your exam board, you can ensure that your answers meet
the expectations of the examiners and are easier to read and understand
Here are some suggested subsystems for the check time function:
• Purpose: Ensure alarms work reliably, even when the device is in low-power
mode or sleep mode.
• Key Tasks:
• Use wake locks or background services to keep the alarm checking active.
• Optimize battery usage to minimize drain while still checking time accurately.
• Handle scenarios like the device being powered off or in airplane mode.
Dividing the check time function into these subsystems allows the alarm app to be more
modular and scalable. Each subsystem focuses on a specific aspect of the alarm functionality,
making it easier to test and maintain individually.
Flowchart Design
No, Cambridge IGCSE (CIE) and Edexcel IGCSE generally follow the same standard flowchart
symbols for their Computer Science exams. Both exam boards adhere to widely accepted
conventions in flowchart design, which are based on industry-standard symbols defined by
organizations like the International Organization for Standardization (ISO) and the American
National Standards Institute (ANSI).
Here are the key symbols you should be familiar with for both exam boards:
• Both CIE and Edexcel use similar symbols and follow standard flowchart
conventions, so you do not need to learn different flowchart formats for each exam board.
• Consistency in flowchart design is important for clarity, so stick to the symbols
recommended above.
• In both exams, it’s crucial to label decisions clearly and ensure that flow lines are
used logically to connect the different steps in your flowchart.
This flowchart would look the same in both CIE and Edexcel contexts using the symbols
mentioned above.
Conclusion
Both CIE and Edexcel expect students to use industry-standard flowchart symbols in their
Computer Science exams. As
, single transaction cannot purchased more than 25, if number of tickets are more than 10, give
10% discount, if more than 20, give 20% discount.
To implement the algorithm you’ve described for purchasing tickets, we need to incorporate the
following conditions:
1. Limit on tickets: A single transaction cannot purchase more than 25 tickets.
2. Discount:
• If the number of tickets is more than 10, apply a 10% discount.
• If the number of tickets is more than 20, apply a 20% discount.
Python Code
def calculate_total_cost(num_tickets):
# Set the base price of a single ticket
ticket_price = 100 # You can adjust this value as needed
# Example usage:
num_tickets = int(input("Enter the number of tickets you want to purchase: "))
result = calculate_total_cost(num_tickets)
print(result)
1. Function Definition:
• The function calculate_total_cost() takes the number of tickets as input.
• The base price of a ticket is set to 100 units (you can adjust this as needed).
2. Ticket Limit Check:
• If num_tickets exceeds 25, it returns an error message indicating that the
purchase limit has been reached.
3. Discount Calculation:
• If more than 20 tickets are purchased, a 20% discount is applied.
• If more than 10 tickets are purchased (but not more than 20), a 10% discount is
applied.
• Otherwise, no discount is given.
4. Final Cost Calculation:
• The final cost is calculated after applying the discount, and the result is rounded
to 2 decimal places for better readability.
Sample Output
Pseudocode exercise
Here are a few simple exercises in pseudocode that include IF...THEN...ELSE...ENDIF and
CASE...ENDCASE statements to help you practice.
START
INPUT number
IF number > 0 THEN
PRINT "The number is positive."
ELSE IF number < 0 THEN
PRINT "The number is negative."
ELSE
PRINT "The number is zero."
ENDIF
END
This pseudocode asks for the day number (1 to 7) and outputs the corresponding day of the
week using a CASE...ENDCASE structure.
START
INPUT dayNumber
CASE dayNumber OF
1: PRINT "Monday"
2: PRINT "Tuesday"
3: PRINT "Wednesday"
4: PRINT "Thursday"
5: PRINT "Friday"
6: PRINT "Saturday"
7: PRINT "Sunday"
ENDCASE
END
3. Grade Classification
This pseudocode uses IF...THEN...ELSE to classify a student’s grade based on their score.
START
INPUT score
IF score >= 90 THEN
PRINT "Grade A"
ELSE IF score >= 80 THEN
PRINT "Grade B"
ELSE IF score >= 70 THEN
PRINT "Grade C"
ELSE IF score >= 60 THEN
PRINT "Grade D"
ELSE
PRINT "Grade F"
ENDIF
END
This pseudocode simulates a basic traffic light control using a CASE...ENDCASE structure.
START
INPUT lightColor
CASE lightColor OF
"Red": PRINT "Stop"
"Yellow": PRINT "Get Ready"
"Green": PRINT "Go"
ELSE: PRINT "Invalid color"
ENDCASE
END
START
INPUT num1, num2, num3
IF num1 >= num2 AND num1 >= num3 THEN
PRINT "The largest number is ", num1
ELSE IF num2 >= num1 AND num2 >= num3 THEN
PRINT "The largest number is ", num2
ELSE
PRINT "The largest number is ", num3
ENDIF
END
These exercises will help you practice controlling program flow based on conditions, a
fundamental concept in algorithm design.
CASE OF Choice
1 : Answer ← Num1 + Num2
2 : Answer ← Num1 - Num2
3 : Answer ← Num1 * Num2
4 : Answer ← Num1 / Num2
OTHERWISE OUTPUT "Please enter a valid choice"
ENDCASE
Here’s the Python equivalent for the pseudocode you provided using an if-elif-else structure.
Since Python does not have a direct CASE OF statement, we’ll use conditional statements to
achieve the same functionality.
Python Code:
Explanation:
1. Inputs:
• choice: The user selects an option between 1 and 4.
• num1 and num2: The two numbers to perform the operation on.
2. Conditional Checks:
• If choice is 1, it adds the numbers.
• If choice is 2, it subtracts the numbers.
• If choice is 3, it multiplies the numbers.
• If choice is 4, it divides the numbers (with a check to prevent division by zero).
• If choice does not match 1-4, it prints an error message.
Sample Output:
This Python code replicates the behavior of your pseudocode using a series of if-elif-else
statements.
Pseudocode for activity 7.5
BEGIN
READ DAY
CASE DAY OF
1: PRINT "Sunday"
2: PRINT "Monday"
3: PRINT "Tuesday"
4: PRINT "Wednesday"
5: PRINT "Thursday"
6: PRINT "Friday"
7: PRINT "Saturday"
OTHERWISE
PRINT "Error: Invalid day. Please enter a number between 1 and 7."
END CASE
END
Here’s the Python code for each of the three pseudocode examples you provided.
1. FOR … TO … NEXT
Pseudocode:
FOR Counter ← 1 TO 10
OUTPUT "*"
NEXT Counter
Python Code:
Explanation:
Pseudocode:
Counter ← 0
REPEAT
OUTPUT "*"
Counter ← Counter + 1
UNTIL Counter > 9
Python Code:
3. WHILE … DO … ENDWHILE
Pseudocode:
Counter ← 0
WHILE Counter < 10 DO
OUTPUT "*"
Counter ← Counter + 1
ENDWHILE
Python Code:
Explanation:
All three examples should work as intended, producing a line of "*" symbols according to their
respective loop structures. Let me know if you need any further clarification!