AS Computer Science 9618 P2
AS Computer Science 9618 P2
AS Computer Science 9618 P2
ABSTRACTION
= the process of extracting information that is essential, 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
+ Program is smaller in size so takes up less space in memory and download times are
shortened
+ Customers 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 write a comp program,
each final part is defined as a
separate program module that can
be written and tested 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 on 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 a structure of an algorithm
3. Pseudocode
- a method of showing the detailed logical steps in an algorithm, using keywords, identifier
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 on an item of data
ARRAYS
= a data structure containing several elements of the same data types
- Index = the position of each element in 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
sepratly by the use of an index
- Hence, 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 make 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 os 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
1. OPEN FILE
2. EOF
3. CLOSE FILE
ABSTRACT DATA TYPE (ADT)
= a collection of data and a set of operations on that list
= 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 start 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
LINKED LIST
CH12 - SOFTWARE DEVELOPMENT
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
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
1. SYNTAX ERROR
= errors in the grammar of a source program
- during the program development life cycle, program are either compiled or
interpreted so they can be executed
- During this operation, the syntax if the program is checked, and errors need to be
corrected before the program can be executed
- Many IDE offers suggestion about what syntax errors are and how to correct
them
2. LOGIC ERROR
= errors in the logic of a program => program does not do what it’s supposed to do
- found when the program is being tested
- Many IDE allows you to single step through the program to find errors
- Manually check using trace table
- Trace Table = shows the process of dry-running a program with columns
showing the values of each variables as it changes
3. RUN-TIME ERRORS
= an error found in a program when it is executed, the program may stop unexpectedly
- when program is tested in IDE, this type of error may be managed, and a suitable
error message given
- If program has been released for use and a run-time error occurs, the developer
should be informed so that the program can be updated and re-released or a
patch can be sent out to all customers to solve the problem
- Patch = a small program, released by the developers, to run with an
existing program to correct an error or to provide extra functionality
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