AS Computer Science 9618 P2
AS Computer Science 9618 P2
ABSTRACTION
- the process of extracting essential information, while ignoring what is not
relevant, for the provision of a solution
- Encourages the development of simplified models that are suited to a specific purpose
by eliminating any unnecessary characteristics from that model
- Ex: Map, Calendar, Timetables
- Maps to show what is required for a specific purpose: road map
- Only showing essential details needed
Benefits:
+ the time required to develop the program is reduced so the program can be delivered to
the customer more quickly
+ The program is smaller in size so it takes up less space in memory and download times
are shortened
+ Customer satisfaction is greater as their requirements are met without any extraneous
features
HOW
- identify the purpose of the model of the situation that is to be built
- Once identified, sources of information need to be identified (observations, view of
potential users, evidence of existing models)
- Use information gathered from appropriate sources to identify what details need to be
included in the model (details to be presented, need to be removed, etc)
DECOMPOSITION
= the process of breaking a complex problem into smaller parts until each part is easy to
examine and understand, hence a solution can be developed for it
Pattern Recognition
= used to identify those parts that
are similar and could use the same
solution
- led to the development of
reusable program code in the form
of subroutines, procedures, and
functions
- When writing a comp
program, each final part is defined
as a separate program module that
can be written and tested with a
separate procedure or function
ALGORITHMS
= an ordered set of steps to be followed in the completion of a task
METHODS
1. Structured English
- method of showing the logical steps of the algorithm using an agreed subset of
straightforward English words for commands and mathematical operations
2. FlowChart
- a diagrammatic representation of an algorithm
- To show the structure of an algorithm
3. Pseudocode
- a method of showing the detailed logical steps in an algorithm, using keywords,
identifiers with meaningful names, and mathematical operators
- Not follow the syntax of a specific programming language, but provide sufficient detail to
allow a program to be written in a high-level language
STEPWISE REFINEMENT
= the practice of subdividing each part of a larger problem into a series of smaller parts, and so
on, as required
CH10 - DATA TYPES AND STRUCTURES
DATA TYPES
= a classification of different types of data
- Determine properties like what operations can be conducted on the data and how the
data will be stored
RECORD
= a composite data type comprising several related items that may be of different data types
*Composite Data Type = a data type constructed using several of the basic data types available
in a particular programming language
- must be defined before it can be used
- Any data type not provided by a programming language must be defined before it can be
used
In records, there is an IDENTIFIER
- Identifier = a unique name applied to an item of data
ARRAYS
= a data structure containing several elements of the same data types
- Index = the position of each component of an array
- Lower Bound = the index of the first element in an array
- Usually 0 or 1
- Upper Bound = the Index of the last element in an array
- Why?
- Used to store multiple data types in a uniformly accessible manner
- All data types use the same identifier and each data item can be accessed
separately by the use of an index
- Hence, a list of items can be stored, searched, and put into an order
1D ARRAYS
= a list
2D ARRAYS
= a table, with rows and columns
LINEAR SEARCH
= a method of searching in which each element of an array is checked in order
- uses variables Upperbound and Lowerbound so that the algorithm is easier to adapt for
different lengths of list
- REPEAT UNTIL loop makes use of 2 conditions, so that the algorithm is more efficient,
termination as soon as the item is found in the list
IDENTIFIER TABLE
- good practice to provide an identifier table to keep track of and explain the use of each
identifier in an algorithm
- Allows the programmer to keep track of the identifiers used and provides a useful
summary of identifiers and their uses if the algorithm requires modification at a later date
BUBBLE SORT
= a method of sorting data in an array into alphabetical or numerical order by comparing
adjacent items and swapping them if they are in the wrong order
- start from the lower bound and finishing with the element next to the upper bound
- The element at the upper bound is now in the correct position
- This comparison is repeated with 1 less element in the list until there is only 1 element
left or no swaps are made
FILE
= a collection of data stored by a computer program to be used again
2. EOF
= a list containing several = a list containing several = a list containing several items
items operating on the items operating on the first in, in which each item in the list
last in, first out (LIFO) first out (FIFO) principle points to the next item in the list
principle
➔ uses two pointers ➔ uses two pointers ➔ Uses a smart pointer that
➔ A base pointer ➔ A front pointer points points to the first item in
points to the first to the first item in the the linked list
item in the stack
queue and a rear ➔ Every item in a linked list
and a top pointer
points to the last pointer points to the is stored together with a
item in the stack last item in the queue pointer to the next item
➔ When they are ➔ When there are equal, ➔ This is called a node
equal there is only there is only one item ➔ The last item in a linked
one item in the in the queue list has a null pointer
stack
QUEUE
LINKED LIST
CH12 - SOFTWARE DEVELOPMENT
PROGRAM DEVELOPMENT LIFECYCLE
PURPOSE OF A PROGRAM DEVELOPMENT LIFECYCLE
- To develop a successful program or suite of programs that is going to be used by others
to perform a specific task
STAGES
1. Analysis
- A process of investigation, leading to the specification of what a program is required to
do
2. Design
- Uses the program specification from the analysis stage to show how the program should
be developed
3. Coding
- The writing of the program or suite of programs
4. Testing
- The testing of the program to make sure that it works under all conditions
5. Maintenance
- The process of making sure that the program continues to work during use
WATERFALL MODEL
= A linear sequential program development cycle, in which each stage is completed before the
next is begun
ITERATIVE MODEL
= a type of program development cycle in which a simple subset of the requirements is
developed, then expanded or enhanced, with the development cycle being repeated until the full
system is deployed
PROGRAM DESIGN
STRUCTURE CHART
= a modeling tool used to decompose a problem into a set of sub-tasks
- shows the hierarchy or structure of the different modules and how they connect and
interact with each other
- Show selection
- Show repetition
TYPES OF ERRORS
PROGRAM TESTING
TEST STRATEGY
= an overview of the testing required to meet the requirements specified for a particular program
- shows how and when the program is to be tested
TEST PLAN
= a detailed list showing all the stages of testing and every test that will be performed for a
particular program
- to clarifier what tests need be perform
During the program design stage, pseudocode is written
- Tested using a dry run on trace table
- Dry Run = a method of testing a program that involves working though a program
or module from a program manually
WALKTHROUGH
= formalized version of a dry run using predefined test cases
- When another member of the development team independently dry runs the
pseudocode, or the developers takes the team members through the dry run process
- Often does as a demonstration
- During the program development and testing, each module is tested as set out in the
test plan