Jump to content

A-level Computing/CIE/Fundamental Problem-solving and Programming skills/Algorithm design and problem-solving

From Wikibooks, open books for an open world
Specification link

Algorithms

  • show understanding that an algorithm is a solution to a problem expressed as a sequence of defined steps
  • use suitable identifier names for the representation of data used by a problem
    • summarise identifier names using an identifier table
  • show understanding that many algorithms are expressed using the four basic constructs of assignment, sequence, selection and repetition
  • show understanding that simple algorithms consist of input, process, output at various stages
  • document a simple algorithm using:
    • structured English
    • pseudocode (on the examination paper, any given pseudocode will be presented using the Courier New font)
    • program flowchart
  • use the process of stepwise refinement to express an algorithm to a level of detail from which the task may be programmed
  • decompose a problem into sub-tasks leading to the concept of a program module (procedure/function)
  • show an appreciation of why logic statements are used to define parts of an algorithm solution
  • use logic statements to define parts of an algorithm solution

Structure chart

  • use a structure chart to express the inputs into and output from the various modules/procedures/functions which are part of the algorithm design
  • describe the purpose of a structure chart
  • construct a structure chart for a given problem
  • derive equivalent pseudocode from a structure chart

Corrective maintenance

  • perform white-box testing by:
    • selecting suitable data
    • using a trace table
  • identify any error(s) in the algorithm by using the completed trace table
  • amend the algorithm if required

Adaptive maintenance

  • make amendments to an algorithm and data structure in response to specification changes
  • analyse an existing program and make amendments to enhance functionality

Structure Charts

[edit | edit source]
Structure charts can map the structure and data flow of complicated tasks

A Structure Chart in software engineering is a chart which shows the breakdown of a system to its lowest manageable parts. They are used in structured programming to arrange program modules into a tree. Each module is represented by a box, which contains the module's name. The tree structure visualizes the relationships between modules, showing data transfer between modules using arrows. Structured Charts are an example of a top-down design where a problem (the program) is broken into its components. The tree shows the relationship between modules, showing data transfer between the models.

Symbol Name Meaning
Module
Name
Process Each Box represents a programming module, this might be something that calculates the average of some figures, or prints out some pay slips
Data Couple Data being passed from module to module that needs to be processed.
Flag [Extension - you don't need to know this for the exam] Check data sent to process to stop or start processes. For example when the End of a File that is being read is reached, or a flag to say whether data sent was in the correct format

Selection

[edit | edit source]
Structure Chart representation of the selection code

A selection in a Structure Chart is determined by the diamond symbol. This means a condition will be checked and depending on the result, different modules will be executed.

Iteration

[edit | edit source]
Structure Chart of the code to the left

Using the semi circular arrow we can represent iteration in Structure Charts.