knowt logo

Computational Thinking and Programming (WJEC)

This unit involves various essential topics in computer science from problem-solving strategies to algorithms and programming constructs, exploring programming languages, data structures, data types, and the critical aspects of security and authentication.

Problem-Solving

  • Programmers Need to Understand the Problem

    • Write programs only if they understand the problem.

    • Develop good computational thinking skills.

    • Break problems into manageable chunks.

    • Simplify the situation.

  • Computational Thinking

    • Represent problems as steps (algorithms).

  • Decomposition

    • Break down a large problem into smaller sub-problems.

    • Each sub-problem can be solved independently.

    • Different people can work on different sub-problems.

    • Solutions to sub-problems combine to solve the whole problem.

  • Abstraction

    • Reduce a problem to its simplest characteristics.

    • Focus on the most important aspects.

  • Variables

    • Store data that can change.

    • Given identifiers reflecting the data stored (e.g., txt_FirstName).

    • Types of Variables

      • Local Variables: Defined within a specific function or block.

      • Global Variables: Accessible throughout the program.

      • Static Variables: Retain their value between function calls.

      • Dynamic Variables: Memory allocation can change during runtime.

  • Constants

    • Store data that does not change.

    • Given self-documenting identifiers (e.g., PI = 3.14).

  • Modularization

    • Structure programs into modular parts with clear, well-documented interfaces.

    • Ensure modules are independent and reusable.

Algorithms and Sorting

  • Algorithms Set of instructions to solve a problem.

    • Must be clear and ordered.

    • Should be language-independent (pseudo code or flowcharts).

    • Finite, well-defined, and effective.

  • Pseudo Code and Flowcharts

    • Pseudo Code: Instructions in plain English.

    • Flowcharts: Diagrams showing step-by-step instructions.

  • Sorting

    • There are many different types of search and sort algorithms that help you traverse through code and help you code faster and more efficiently

    • Merge Sort: Divide list into halves and recursively sort and merge.


    • Bubble sort: compare and swap items

  • Searching

    • Linear Search: Sequentially compare each item

    • Binary Search: Repeatedly divide list and compare middle item

Algorithms and Programming Constructs

  • Programming Constructs

    • Subroutines: Functions or procedures that perform a specific task.

    • Sequence: Execution of statements in a linear order.

    • Selection: Decision-making using conditional statements (if-else).

    • Iteration: Repeating a block of code (loops).

  • Counts and Rogue Values

    • Counts: Variables used to count occurrences or iterations.

    • Rogue Values: Special values that signal the end of a list or dataset.

  • Object-Oriented Constructs

    • Classes and Objects: Define blueprints (classes) and create instances (objects).

    • Encapsulation: Keep data and methods safe within a class.

    • Inheritance: Derive new classes from existing ones.

    • Polymorphism: Use a single interface to represent different data types.

  • Input, Processing, Output

    • Input: Data received from users or external sources.

    • Processing: Operations performed on data.

    • Output: Result of processing, presented to users.

  • String Handling

    • Use routines like concatenation, substring, and length calculations.

  • Mathematical Operations

    • Include addition, subtraction, multiplication, division, modulus, and exponentiation.

  • Logical Operations

    • AND, OR, NOT, XOR: Used in decision-making and control flow.

Program Testing

Importance of Testing

  • Ensures the program works as expected.

  • Identifies and fixes bugs before deployment.

  • Improves program reliability and performance.

Types of Testing and Evaluation

  1. Unit Testing:

    • Tests individual components or functions of the program.

    • Ensures each part works correctly in isolation.

  2. Integration Testing:

    • Tests how different components or functions work together.

    • Ensures integrated parts function correctly as a whole.

  3. System Testing:

    • Tests the entire system as a whole.

    • Ensures the complete program meets the specified requirements.

  4. Acceptance Testing:

    • Conducted by end-users.

    • Ensures the program meets their needs and requirements.

  5. Regression Testing:

    • Ensures new changes or additions do not break existing functionality.

    • Re-runs previous tests to check for new bugs.

  • Evaluation

    • Assess how well an algorithm or program meets requirements.

    • Use logical reasoning and test data to determine efficiency.

Programming Languages

  • Markup Languages (HTML)

    • Design and structure web pages using HTML elements (tags).

  • Object-Oriented Languages (Java)

    • Greenfoot Environment: Utilize Greenfoot to create and manipulate objects and worlds.

    • Implement various concepts like inheritance, encapsulation, and polymorphism.

  • Assembly Language

    • Low-level programming with specific mnemonics for operations.

Data Structures and Data Types

  • Implementing Data Structures

    • Arrays: Use one-dimensional and two-dimensional arrays for storing elements.

    • Files and Records: Organize data into structured formats.

  • Implementing Data Types

    • Use data types such as integer, Boolean, real, character, and string.

  • Variables and Constants

    • Describe scope (local/global) and lifetime in programs.

Security and Authentication

  • Security Techniques

    • Use validation and authentication to secure programs.

    • Implement measures to protect data and prevent unauthorized access.

Program Maintenance

  • Corrective Maintenance: Fixing bugs found after the program is deployed.

  • Adaptive Maintenance: Updating the program to work with new hardware or software.

  • Perfective Maintenance: Enhancing the program's features and performance.

  • Preventive Maintenance: Making changes to prevent future problems.

Documentation

  • User Documentation: Instructions and guides for end-users on how to use the program.

  • Technical Documentation: Detailed information for developers on how the program works, including code comments, design documents, and technical specifications.

Version Control

  • Keeps track of changes made to the program.

  • Helps manage multiple versions of the program.

  • Allows collaboration among multiple developers.

  • Common tools: Git, SVN.

Code Review

  • Regularly reviewing code with peers.

  • Helps catch bugs early and improves code quality.

  • Encourages sharing of knowledge and best practices among developers.



A

Computational Thinking and Programming (WJEC)

This unit involves various essential topics in computer science from problem-solving strategies to algorithms and programming constructs, exploring programming languages, data structures, data types, and the critical aspects of security and authentication.

Problem-Solving

  • Programmers Need to Understand the Problem

    • Write programs only if they understand the problem.

    • Develop good computational thinking skills.

    • Break problems into manageable chunks.

    • Simplify the situation.

  • Computational Thinking

    • Represent problems as steps (algorithms).

  • Decomposition

    • Break down a large problem into smaller sub-problems.

    • Each sub-problem can be solved independently.

    • Different people can work on different sub-problems.

    • Solutions to sub-problems combine to solve the whole problem.

  • Abstraction

    • Reduce a problem to its simplest characteristics.

    • Focus on the most important aspects.

  • Variables

    • Store data that can change.

    • Given identifiers reflecting the data stored (e.g., txt_FirstName).

    • Types of Variables

      • Local Variables: Defined within a specific function or block.

      • Global Variables: Accessible throughout the program.

      • Static Variables: Retain their value between function calls.

      • Dynamic Variables: Memory allocation can change during runtime.

  • Constants

    • Store data that does not change.

    • Given self-documenting identifiers (e.g., PI = 3.14).

  • Modularization

    • Structure programs into modular parts with clear, well-documented interfaces.

    • Ensure modules are independent and reusable.

Algorithms and Sorting

  • Algorithms Set of instructions to solve a problem.

    • Must be clear and ordered.

    • Should be language-independent (pseudo code or flowcharts).

    • Finite, well-defined, and effective.

  • Pseudo Code and Flowcharts

    • Pseudo Code: Instructions in plain English.

    • Flowcharts: Diagrams showing step-by-step instructions.

  • Sorting

    • There are many different types of search and sort algorithms that help you traverse through code and help you code faster and more efficiently

    • Merge Sort: Divide list into halves and recursively sort and merge.


    • Bubble sort: compare and swap items

  • Searching

    • Linear Search: Sequentially compare each item

    • Binary Search: Repeatedly divide list and compare middle item

Algorithms and Programming Constructs

  • Programming Constructs

    • Subroutines: Functions or procedures that perform a specific task.

    • Sequence: Execution of statements in a linear order.

    • Selection: Decision-making using conditional statements (if-else).

    • Iteration: Repeating a block of code (loops).

  • Counts and Rogue Values

    • Counts: Variables used to count occurrences or iterations.

    • Rogue Values: Special values that signal the end of a list or dataset.

  • Object-Oriented Constructs

    • Classes and Objects: Define blueprints (classes) and create instances (objects).

    • Encapsulation: Keep data and methods safe within a class.

    • Inheritance: Derive new classes from existing ones.

    • Polymorphism: Use a single interface to represent different data types.

  • Input, Processing, Output

    • Input: Data received from users or external sources.

    • Processing: Operations performed on data.

    • Output: Result of processing, presented to users.

  • String Handling

    • Use routines like concatenation, substring, and length calculations.

  • Mathematical Operations

    • Include addition, subtraction, multiplication, division, modulus, and exponentiation.

  • Logical Operations

    • AND, OR, NOT, XOR: Used in decision-making and control flow.

Program Testing

Importance of Testing

  • Ensures the program works as expected.

  • Identifies and fixes bugs before deployment.

  • Improves program reliability and performance.

Types of Testing and Evaluation

  1. Unit Testing:

    • Tests individual components or functions of the program.

    • Ensures each part works correctly in isolation.

  2. Integration Testing:

    • Tests how different components or functions work together.

    • Ensures integrated parts function correctly as a whole.

  3. System Testing:

    • Tests the entire system as a whole.

    • Ensures the complete program meets the specified requirements.

  4. Acceptance Testing:

    • Conducted by end-users.

    • Ensures the program meets their needs and requirements.

  5. Regression Testing:

    • Ensures new changes or additions do not break existing functionality.

    • Re-runs previous tests to check for new bugs.

  • Evaluation

    • Assess how well an algorithm or program meets requirements.

    • Use logical reasoning and test data to determine efficiency.

Programming Languages

  • Markup Languages (HTML)

    • Design and structure web pages using HTML elements (tags).

  • Object-Oriented Languages (Java)

    • Greenfoot Environment: Utilize Greenfoot to create and manipulate objects and worlds.

    • Implement various concepts like inheritance, encapsulation, and polymorphism.

  • Assembly Language

    • Low-level programming with specific mnemonics for operations.

Data Structures and Data Types

  • Implementing Data Structures

    • Arrays: Use one-dimensional and two-dimensional arrays for storing elements.

    • Files and Records: Organize data into structured formats.

  • Implementing Data Types

    • Use data types such as integer, Boolean, real, character, and string.

  • Variables and Constants

    • Describe scope (local/global) and lifetime in programs.

Security and Authentication

  • Security Techniques

    • Use validation and authentication to secure programs.

    • Implement measures to protect data and prevent unauthorized access.

Program Maintenance

  • Corrective Maintenance: Fixing bugs found after the program is deployed.

  • Adaptive Maintenance: Updating the program to work with new hardware or software.

  • Perfective Maintenance: Enhancing the program's features and performance.

  • Preventive Maintenance: Making changes to prevent future problems.

Documentation

  • User Documentation: Instructions and guides for end-users on how to use the program.

  • Technical Documentation: Detailed information for developers on how the program works, including code comments, design documents, and technical specifications.

Version Control

  • Keeps track of changes made to the program.

  • Helps manage multiple versions of the program.

  • Allows collaboration among multiple developers.

  • Common tools: Git, SVN.

Code Review

  • Regularly reviewing code with peers.

  • Helps catch bugs early and improves code quality.

  • Encourages sharing of knowledge and best practices among developers.



robot