Designing, Creating & Refining Algorithms (OCR GCSE Computer Science)

Flashcards

1/39

Enjoying Flashcards?
Tell us what you think

Cards in this collection (39)

  • Define an input.

    An input is data or information being entered/taken into a program before it is processed in the algorithm.

  • Define a process?

    A process is a doing action performed in the algorithm that transforms inputs into the desired output.

  • Define an output.

    An output is the result of the processing in an algorithm and usually the way a user can see if an algorithm works as intended.

  • True or False?

    A keyboard is an example of an output.

    False.

    Sources like a keyboard, mouse, game controller and microphone are all inputs.

  • True or False?

    A sensor would be an example of an output.

    False.

    The numbers that are processed from the sensor would be an output.

  • True or False?

    Averaging a data set would be an example of a process.

    True.

    Any calculation or comparison of numbers would be a process.

  • What is a structure diagram?

    A structure diagram is a visual representation of problem decomposition.

  • What is a structure diagram used for?

    A planning tool for developers during the analysis of a problem.

  • True or False?

    Structure diagrams visually represent abstraction.

    False.

    Structure diagrams visually represent problem decomposition, not abstraction.

  • Define the term decomposition.

    Decomposition is the process of breaking down a large problem into a set of smaller problems.

  • Define the term manageable (in the context of structure diagrams).

    Manageable refers to sub-problems that are small enough to be handled or dealt with more easily than the original complex problem.

  • Define the term analysis

    Analysis is the process of studying or examining a problem in detail to understand its nature and determine a solution.

  • What is the purpose of using structure diagrams during problem analysis?

    Structure diagrams help developers plan and visualise how a complex problem can be broken down into smaller, more manageable sub-problems.

  • Give an example of when a structure diagram would be useful.

    Structure diagrams would be useful when designing a complex system like a mobile app or game with multiple features and functionalities.

  • What is pseudocode?

    Pseudocode is a text based tool that uses short English words/statements to describe an algorithm.

  • True or False?

    In pseudocode For loop from 1 to 5 repeats 5 times?

    True.

    The loop For loop from 1 to 5 would repeat 5 times.

  • What is the advantage of pseudocode over natural language?

    Pseudocode is more structured than writing sentences in English, but is very flexible.

  • What is OCR exam reference language?

    OCR exam reference language is the officially designed pseudocode that is seen in OCR based exams to describe algorithms.

  • What does this pseudocode statement do?

    total = total + 5

    total = total + 5

    This would add 5 to the variable 'total'

  • What is a flowchart?

    Flowcharts are a visual tool that uses shapes to represent different functions to describe an algorithm.

  • Which flowchart symbol is used for decisions?

    Diamond

  • What do flowcharts show?

    Flowcharts show the data that is input and output, the processes that take place and any decisions or repetition.

  • True or False?

    You can write algorithms in Python where the question asks for OCR exam reference language.

    True.

    OCR exam reference language is very close to Python syntax that you can write algorithms in Python in the exam.

  • Define syntax error.

    A syntax error is an error that breaks the grammatical rules of a programming language and stops it from running.

  • True or False?

    Typos and spelling errors are examples of syntax errors.

    True.

    Typos and spelling errors violate the correct syntax of the programming language, making it difficult for the compiler or interpreter to understand the code.

  • True or False.

    Missing or extra brackets or quotes are examples of syntax errors.

    True.

    Missing or extra brackets or quotes disrupt the code structure, violating syntax rules and causing errors.

  • True or False?

    Misplaced or missing semicolons are examples of syntax errors.

    True.

    Misplaced or missing semicolons can lead to syntax errors as they are used to denote the end of statements.

  • True or false?

    Incorrect use of operators is an example of a syntax error.

    False.

    These would be examples of logic errors

  • Define a logic error

    A logic error is where incorrect code is used that causes the program to run, but produces an incorrect output or result.

  • True or False?

    A logic error occurs when the program does not produce the expected output due to incorrect programming logic.

    True.

    The definition of a logic error is where incorrect code is used that causes the program to run, but produces an incorrect output or result.

  • What is a trace table?

    A trace table is used to test algorithms and programs for logic errors that appear when an algorithm or program executes.

  • What three methods of designing algorithms can a trace table help to test?

    A trace table can be used to help test:

    • flowcharts

    • pseudocode

    • program code.

  • True or False?

    A trace table can be used to discover the purpose of an algorithm

    True.

    A trace table can be used to discover the purpose of an algorithm by showing output data and intermediary steps.

  • True or False?

    A trace table can be used to record the state of an algorithm.

    True.

    A trace table can be used to record the state of the algorithm at each step or iteration.

  • How is a trace table used?

    Each stage of the algorithm is executed step by step in a trace table.

  • What can be checked in a trace table?

    Inputs, outputs, variables and processes can be checked for the correct value when the stage is completed in a trace table.

  • True or False?

    Trace tables are only used with program code.

    False.

    Trace tables can be used with flowcharts, pseudocode or program code.

  • Define the term iteration (in the context of trace tables).

    Iteration refers to each repetition or loop cycle in an algorithm that can be recorded in a trace table.

  • Define the term intermediary (in the context of trace tables).

    Intermediary refers to the intermediate or in-between steps and values calculated during the execution of an algorithm, which can be shown in a trace table.