A-level Computing/CIE/Fundamental Problem-solving and Programming skills/Data representation

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Specification link

Data types

  • select appropriate data types for a problem solution
  • use in practical programming the data types that are common to procedural high-level languages: integer, real, char, string, Boolean, date (pseudocode will use the following data types: INTEGER, REAL, CHAR, STRING, BOOLEAN, DATE, ARRAY, FILE)
  • show understanding of how character and string data are represented by software including the ASCII and Unicode character sets

Arrays

  • use the technical terms associated with arrays including upper and lower bound
  • select a suitable data structure (1D or 2D array) to use for a given task
  • use pseudocode for 1D and 2D arrays (pseudocode will use square brackets to contain the array subscript, for example a 1D array as A[1:n] and a 2D array as C[1:m, 1:n])
  • write program code using 1D and 2D arrays
  • write algorithms/program code to process array data including:
    • sorting using a bubble sort
    • searching using a linear search.

Files

  • show understanding of why files are needed
  • use pseudocode for file handling:

OPENFILE <filename> FOR READ/WRITE/APPEND // Open file (understand the difference between various file modes)
READFILE <filename>,<string> // Read a line of text from the file
WRITEFILE <filename>,<string> // Write a line of text to the file
CLOSEFILE // Close file
EOF() // function to test for the end of the file

  • write program code for simple file handling of a text file, consisting of several lines of text

Cambridge International state that using the With command in Python is acceptable. (In official newsgroup for teachers)