TOPIC 2 - Programming Knowledge Organiser Quizlets 02…
Writing High-Level Input and Validation Variables & constants Data types
Programs Input data and store in variable Named storage location Integer e.g. 23
Open an IDE e.g. IDLE Validation reserved in memory. Real (float) e.g. 23.7
Type working code o check input is reasonable Declaring Character e.g. A or 5
Save and Run o types of validation: length, presence, Definitions String e.g. A546TH
Edit and debug type etc. Purpose of variable Boolean e.g. True/False
Explain the results Respond to input (e.g. selection) Purpose of constant Casting functions int, str
Readability of Code Testing and Debugging
Comments Types of error & how to fix
o Explain the code o Syntax error
o Document o Runtime error
Descriptive identifier names o Logic/Semantic error
o e.g. camelCase Writing Test Plans
Indentation and white space Choosing Test Data
o valid aka normal
Code Constructs o extreme aka boundary
Sequence o invalid aka erroneous
Selection Writing Trace Tables
o if-elif-else Completing the test report
Iteration
o count-controlled (for)
Operators
o condition-controlled (while)
Mathematical Operators
Subprograms o + - / *, MOD %, DIV //, EXP **
o Functions
o Order of Precedence: BIDMAS
o Procedures
Relational Operators ==, <, >, <=, >=, !=
o Parameter passing
Logical operators AND, OR, NOT
o Global and Local variables
Built-in and Library Functions
o Built-in e.g. print, input
o Library functions e.g. randint, turtle
TOPIC 2 - Programming Knowledge Organiser Quizlets 02… Use Quizlet study sets
beginning "02" to revise the
2.1.1 be able to write programs in a high-level programming language keywords
understand the benefit of producing programs that are easy to read and be able to use techniques
2.1.2 (comments, descriptive names (variables, constants, subprograms), indentation) to improve readability
and to explain how the code works
2.1.3 be able to differentiate between types of error in programs (logic, syntax, runtime)
2.1.4 be able to design and use test plans and test data (normal, boundary, erroneous)
2.1.5 be able to interpret error messages and identify, locate and fix errors in a program
2.1.6 be able to determine what value a variable will hold at a given point in a program (trace table)
2.1.7 be able to determine the strengths and weaknesses of a program and suggest improvements
understand the structural components of a program (variable and type declarations, command sequences,
2.2.1
selection, iteration, data structures, subprograms)
2.2.2 be able to use sequencing, selection and iteration constructs in their programs
2.3.1 understand the need for, and understand how to use, data types (integer, real, Boolean, char)
understand the need for, and understand how to use, data structures (records, one-dimensional
2.3.2
arrays, two-dimensional arrays)
2.3.3 understand the need for, and how to manipulate, strings
2.3.4 understand the need for, and how to use, variables and constants
2.3.5 understand the need for, and how to use, global and local variables when implementing subprograms
2.4.1 understand how to write code that accepts and responds appropriately to user input
2.4.2 understand the need for, and how to implement, validation
2.4.3 be able to write code that reads/writes from/to a text file
understand the purpose of, and how to use, arithmetic operators (add, subtract, divide, multiply,
2.5.1
modulus, integer division)
understand the purpose of, and how to use, relational operators (equal to, less than, greater than,
2.5.2
not equal to, less than or equal to, greater than or equal to)
2.5.3 understand the purpose of, and how to use, logic operators (AND, OR, NOT)
understand the benefits of using subprograms and be able to write code that uses user-written and
2.6.1
pre-existing (builtin, library) subprograms
2.6.2 understand the concept of passing data into and out of subprograms (procedures, functions)
2.6.3 be able to create subprograms that use parameters
String Manipulation Data structures
Concatenation 1D Arrays and Lists
String Slicing & Indexing Records
.format method 2D Arrays
Escape Sequences /n… Array Indexing
Overview
In this unit you will learn to code in Python, but also learn the principles of programming, how to plan and
write structured code, how to use the main code constructs sequence, selection, iteration and subprograms,
how to spot errors and fix them, how to manipulate data and many more skills that will enable you to code
in other languages in the future.
Resources
The lesson slides and worksheets are, as usual, saved in the Lessons folder. Additional study material can
be found in the Programming folder. Useful books, links and websites follow:
Books
The official Edexcel course book amzn.eu/c3R4kn0
Lots of free Python books http://pythonbooks.revolunet.com/
Computer Coding Games for Kids by Carol Vorderman http://amzn.eu/4GjZGSi
BBC Bitesize
Introduction to Programming
Python Documentation
Hitch hikers guide to Python http://docs.python-guide.org/en/latest/
Python For Non-Programmers http://en.wikibooks.org/wiki/Non-Programmer
%27s_Tutorial_for_Python_3/Intro
Python Web Development http://pypix.com/python/get-started-python-web-development/
Python Learn http://www.pythonlearn.com
Python for Beginners http://www.pythonforbeginners.com
Dive into Python http://www.diveintopython3.net
Python Libraries http://docs.python.org/3/library/
“Let’s Learn Python” instructional videos: https://www.youtube.com/playlist?
list=PL82YdDfxhWsDJTq5f0Ae7M7yGcA26wevJ
FAQ’s
Do I need to write program code in the exam?
Yes, there may be an opportunity to write python code in the exam. So practice this by not using a
computer. Write it out on paper and then test it on the computer.
Misconceptions
The NEA covers a lot of this area of the course, however Paper 2 questions focus on the knowledge behind
this. Can you do it away from the computer? You might be a whizz in Python, but can you explain it,
describe it in an exam?
Edexcel 9-1 Computer Science Specification:
This is what Edexcel say you need to know… Do you?
2.1 Develop code 2.1.1 be able to write programs in a high-level programming language
Topic 2: Programming
understand the benefit of producing programs that are easy to read and be
able to use techniques (comments, descriptive names (variables, constants,
2.1.2
subprograms), indentation) to improve readability and to explain how the
code works
be able to differentiate between types of error in programs (logic, syntax,
2.1.3
runtime)
2.1.4 be able to design and use test plans and test data (normal, boundary,
erroneous)
be able to interpret error messages and identify, locate and fix errors in a
2.1.5
program
be able to determine what value a variable will hold at a given point in a
2.1.6
program (trace table)
be able to determine the strengths and weaknesses of a program and
2.1.7
suggest improvements
understand the structural components of a program (variable and type
2.2.1 declarations, command sequences, selection, iteration, data structures,
2.2 Constructs subprograms)
be able to use sequencing, selection and iteration constructs in their
2.2.2
programs
understand the need for, and understand how to use, data types (integer,
2.3.1
real, Boolean, char)
understand the need for, and understand how to use, data structures
2.3.2
Data types and (records, one-dimensional arrays, two-dimensional arrays)
2.3 structures 2.3.3 understand the need for, and how to manipulate, strings
2.3.4 understand the need for, and how to use, variables and constants
understand the need for, and how to use, global and local variables when
2.3.5
implementing subprograms
understand how to write code that accepts and responds appropriately to
2.4.1
user input
2.4 Input/output
2.4.2 understand the need for, and how to implement, validation
2.4.3 be able to write code that reads/writes from/to a text file
understand the purpose of, and how to use, arithmetic operators (add,
2.5.1
subtract, divide, multiply, modulus, integer division)
understand the purpose of, and how to use, relational operators (equal to,
2.5 Operators
2.5.2 less than, greater than, not equal to, less than or equal to, greater than or
equal to)
2.5.3 understand the purpose of, and how to use, logic operators (AND, OR, NOT)
understand the benefits of using subprograms and be able to write code that
2.6.1
uses user-written and pre-existing (builtin, library) subprograms
2.6 Subprograms understand the concept of passing data into and out of subprograms
2.6.2
(procedures, functions)
2.6.3 be able to create subprograms that use parameters