Caie As Computer Science 9618 Practical Notes and Guide
Caie As Computer Science 9618 Practical Notes and Guide
Caie As Computer Science 9618 Practical Notes and Guide
ORG
CAIE AS LEVEL
COMPUTER
SCIENCE (9618)
SUMMARIZED NOTES ON THE SYLLABUS
CAIE AS LEVEL COMPUTER SCIENCE (9618)
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Boolean:
Date:
File:
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Python:
Reading a file:
Read all characters: variable.read()
A FOR loop is set to stop the sort Read each line and store as list:
Setting a variable ‘sorted’ to be ‘true’ at the beginning variable.readlines()
Another FOR loop is set up next in order to search Writing to a file:
through the array Write a fixed a sequence of characters to file:
An IF is used to see if the first number of the array is variable.write(“Text”)
greater
than the second. If true: Write a list of string to file: variable.write(‘
First number stored to variable ‘.join(‘Z’, ‘Notes’))
Second number assigned as first number
Stored variable assigned to second number
Set ‘sorted’ to ‘false’ causing loop to start again Abstract Data Types
The second FOR loop is count based thus will stop after a
specific
number of times (ADT)
Goes through bigger FOR loop ∴ ‘sorted’ remains ‘true’
This exits the loop ∴ ending the program An Abstract Data Type (ADT) is a collection of data with
associated operations. There are three types of ADTs:
2.6. Linear Search Stack: an ordered collection of items where the addition
of new items and removal of existing items always takes
place at the same end.
Queue: a linear structure which follows the First In First
Out (FIFO) mechanism. Items are added at one end
A FOR loop goes through the array (called the rear) and removed from the other end (called
It compares item in question to those in list using an IF: the front)
If item matches with another then search is stopped Linked List: a linear collection of data elements whose
Also the location where it was found is returned order is not given by physical placements in memory
If not found it exits the FOR loop (non-contiguous). Each element points to the next.
Then returns fact that item in question is not in the list
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
‘’’python <identifier> ← <value>‘’’ or ‘’’python Create routines that can be called like built-in command
<expression>‘’’
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Code program: translate algorithm into high level Example of a top-down design where a problem
language with
comments/remarks and produce user (program) is broken
into its components.
interface with executable
processes
Test and debug program: test program using test data, Rules:
find and
correct any errors and ensure results are correct
Process: Represents a programming module e.g. a
Formalize solution: review program code, revise internal
calculation
documentation and create end-user documentation
Maintain program: provide education and support to
end-user,
correct any bugs and modify if user requests
Waterfall model: a classical model, used to create a Data couple: Data being passed from module to module
system with a linear approach, from one stage to another that needs
to be processed
Iterative model: a initial representation starts with a small
subset, which becomes more complex over time until the
system is complete
Flag: Check data sent to start or stop a process. E.g. check
Rapid Application Development (RAD) model: a
prototyping model, with no (or less) specific planning put if
data sent in the correct format
into it. More emphasis on development and producing a
product-prototype.
Coding:
The IDE executes the code & initial error detection carried
out by
compiler/interpreter doing the following:
Syntax/Logic Error: before program is run, an error
message
warns the user about this
Runtime Error: run of the program ends in an error
Debugging:
Example:
Single stepping: traces through each
line of code and
steps into procedures. Allows you to view the
effect of
each statement on variables
Breakpoints: set within code; program
stops temporarily
to check that it is operating correctly up to that
point
Variable dumps (report window): at
specific parts of
program, variable values shown for comparison
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Alpha testing:
Beta testing:
WWW.ZNOTES.ORG
CAIE AS LEVEL
COMPUTER SCIENCE (9618)