0% found this document useful (0 votes)
14 views3 pages

Chapter 7: Algorithm Design Worksheet

The document consists of a student worksheet and learner notes focused on Chapter 7 of IGCSE Computer Science, covering program development life cycle, decomposition, inputs/outputs, algorithm design, and testing. It includes exercises on pseudocode, flowcharts, validation, verification, and testing data examples. The notes provide detailed explanations of concepts like analysis, design, coding, and the importance of decomposing problems into manageable sub-systems.

Uploaded by

dnhp57qrkv
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

Chapter 7: Algorithm Design Worksheet

The document consists of a student worksheet and learner notes focused on Chapter 7 of IGCSE Computer Science, covering program development life cycle, decomposition, inputs/outputs, algorithm design, and testing. It includes exercises on pseudocode, flowcharts, validation, verification, and testing data examples. The notes provide detailed explanations of concepts like analysis, design, coding, and the importance of decomposing problems into manageable sub-systems.

Uploaded by

dnhp57qrkv
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

✦ Student Worksheet – Chapter 7 Practice

Part A – Short Exercises

Q1. Program Development Life Cycle


a) List the four main stages of the program development life cycle.
b) Explain what happens in the analysis stage, giving one example.
c) Why is testing necessary even after iterative testing?

Q2. Decomposition
A supermarket checkout system needs to:

 Scan items

 Calculate total cost

 Apply discounts

 Print receipt

a) Draw a structure diagram showing the decomposition of this problem.


b) State two advantages of decomposing problems into sub-systems.

Q3. Inputs, Processes, Outputs, Storage


For an online booking system, identify:

 Two inputs

 Two processes

 One output

 One item that needs to be stored

Part B – Algorithm Design

Q4. Pseudocode Writing


Write pseudocode to calculate the average of 5 marks entered by a user.

Q5. Flowchart
Draw a flowchart to find the largest of two numbers entered by the user.

Part C – Exam-Style Questions

Q6. Validation & Verification


Explain the difference between validation and verification, giving one example of each.

Q7. Testing
A program accepts marks between 0 and 100.
a) Give one example of normal test data.
b) Give one example of boundary test data.
c) Give one example of erroneous test data.
✦ Learner Notes – Chapter 7: Algorithm Design and Problem Solving

(IGCSE Computer Science 0478)

1. Program Development Life Cycle (PDLC)

a) Analysis

 Problem is understood and written down clearly.

 Programmers decide: inputs, processes, outputs.

 Example: Library system → input (book ID), process (check if available), output (message).

b) Design

 Plan the solution using:

o Flowcharts

o Pseudocode

o Structure charts

 Example pseudocode (average of 3 numbers):

 input A, B, C

 total ← A + B + C

 average ← total / 3

 output average

c) Coding & Iterative Testing

 Translate design into a programming language (Python, Java, etc.).

 Test modules one by one, fix errors, retest.

d) Testing

 Test the whole program using:

o Normal data (e.g., 50 in a 0–100 range).

o Boundary data (e.g., 0, 100).

o Erroneous data (e.g., –5, 120).

2. Computer Systems and Sub-systems

 A system = hardware + software + data + people + communication.

 Large systems can be broken into sub-systems → smaller manageable parts.

 This is called decomposition or stepwise refinement.

💡 Example: ATM system

 Main system: ATM machine

 Sub-systems: PIN check, balance check, cash withdrawal, print receipt.


3. Decomposing a Problem

Every system has:

 Inputs (data entered by user)

 Processes (calculations, comparisons)

 Outputs (information for user)

 Storage (data saved for later use)

4. Methods of Designing Solutions

 Structure diagrams → break problem into modules.

 Flowcharts → diagram of steps with symbols.

 Pseudocode → structured English-like code.

💡 Example (Find the maximum of 3 numbers):

Pseudocode:

input A, B, C

max ← A

if B > max then max ← B

if C > max then max ← C

output max

Flowchart: Start → Input A,B,C → Compare → Update max → Output max → End

Common questions

Powered by AI

An organization might choose both flowcharts and pseudocode because they complement each other by providing both a visual and textual representation of algorithms. Flowcharts offer a visual depiction of the process flow and decision pathways, making it easy to communicate design to non-programmers. Pseudocode describes the logical steps in more technical detail that can be directly translated into programming code, aiding developers during implementation. This dual approach ensures both clarity and precision in communicating and executing program designs .

Two key methods used in algorithm design are pseudocode and flowcharts. Pseudocode uses structured English-like code to detail the logic and steps in a solution, making it easy to understand without focusing on syntax . Flowcharts use symbols to represent the flow of steps, visually illustrating the process from start to finish, which helps in understanding the sequence and logic .

For an online booking system, two inputs could be user details (e.g., name, contact information) and booking details (e.g., event, date). Two processes might include verifying availability and confirming the booking. An output would be a booking confirmation, such as an email sent to the user confirming their reservation. Inputs gather necessary user and event information; processes ensure that requests are legitimate and slots available, while output communicates successful transactions .

Testing is necessary even after iterative testing because the iterative process focuses on individual modules or components. Comprehensive testing ensures that when these modules are integrated, the entire program functions correctly and meets the specified requirements. This stage includes testing with normal, boundary, and erroneous data to validate overall system behavior and uncover errors not evident in isolated components .

Normal test data example: 50, to confirm the program functions under usual, expected conditions. Boundary test data examples: 0 and 100, to test edge cases at the limits of acceptance criteria to capture borderline failures. Erroneous test data example: -5 or 120, to ensure that inputs outside the defined range are correctly handled and raise appropriate error messages. These types are necessary to ensure robustness and correctness of the program across expected and unexpected conditions .

The four main stages of the Program Development Life Cycle (PDLC) are: 1) Analysis - Understanding and clearly defining the problem. Programmers decide on inputs, processes, and outputs . 2) Design - Planning the solution using flowcharts, pseudocode, and structure charts . 3) Coding & Iterative Testing - Translating design into a programming language and testing modules individually to fix errors . 4) Testing - Testing the entire program using normal, boundary, and erroneous data to ensure correctness .

A structure diagram for a supermarket checkout system can break down the main task into sub-tasks: 1) Scan items - identifying and registering items for purchase. 2) Calculate total cost - summing prices of scanned items. 3) Apply discounts - determining eligible discounts and adjusting the total. 4) Print receipt - generating a physical or digital receipt for the transaction. Each of these tasks can further be decomposed, facilitating focused development and troubleshooting .

Validation checks if software meets user requirements and expectations, such as ensuring a form correctly captures all inputs needed for a process. Verification ensures that the software accurately implements the function design specifications, such as using a spell-checker to ensure accuracy in a word processor. An example of validation is checking a web form for required fields before submission, while verification might involve code reviews or testing to ensure no logic errors are present .

Decomposition is advantageous in problem-solving because it breaks down complex systems into smaller, more manageable sub-systems. This process, also known as stepwise refinement, allows for easier management and understanding of each component, enabling more efficient design, testing, and modification . It ensures that each sub-system, such as for an ATM system (e.g., PIN check, balance check), can be developed and tested independently while contributing to the overall system's functionality .

Pseudocode helps in program design by providing a clear and structured method to outline program logic and operations without being bogged down by syntax-specific details of any particular programming language. It is preferred over natural language as it reduces ambiguity with more technical precision, and over direct coding for initial planning because it allows focus on the algorithmic flow and logic independently of coding errors and constraints .

You might also like