Program Development Life Cycle (PDLC) : Analysis Design
Program Development Life Cycle (PDLC) : Analysis Design
Structure Diagrams
2
This flowchart’s task is to check if a rider’s height is more the requirement (1.2) in this
case. It then counts until the accepted riders are 8. After they are 8, it outputs the number
of rejected riders and tells the rest that they are ready to go!
Pseudocode
Declaration & Usage of Variables & Constants
o Variable – Store of data which changes during execution of the
program (due to user input)
o Constant – Store of data that remains the same during the
execution of the program
Basic Data Types
INTEGER – Whole Number e.g. 2; 8; 100
o REAL – Decimal Number e.g. 7.00; 5.64
o CHARACTER– Single Character e.g. a; Y
o STRING – Multiple Characters (Text) e.g. ZNotes; COOL
o BOOLEAN – Only 2 Values e.g. True/False; Yes/No; 0/1
Input & Output (READ & PRINT) – Used to receive and display data
to the user respectively. (It is recommended to use input and output
commands)
Loop Structures:
6
Test Data
Test data refers to input values used to evaluate and assess the
functionality and performance of a computer program or system.
It helps identify errors and assess how the program handles different
scenarios
Normal data is the test data which accepts values in acceptible range
of values of the program
Normal data should be used to work through the solution to find the
actual result(s) and see if they are the same as the expected result(s)
e.g. in a program where only whole number values ranging from 0 to
100 (inclusive) are accepted, normal test data will be : 23, 54, 64 , 2
and 100
Test data that would be rejected by the solution as not suitable, if the
solution is working properly is called abnormal test data / erroneous
test data.
10
Trace Tables
A trace table is utilized to document the outcomes of every step in an
algorithm. It is employed to record the variable's value each time it
undergoes a change.
A dry run refers to the manual process of systematically executing an
algorithm by following each step in sequence.
A trace table is set up with a column for each variable and a column
for any output e.g.
Test data is employed to execute a dry run of the flowchart and document
the outcomes in a trace table. During the dry run:
Whenever a variable's value changes, the new value is recorded in the
respective column of the trace table.
Each time a value is outputted, it is displayed in the output column.
An example of trace table is given below using a past paper question:
Q: The flowchart below inputs the height of children who want to ride on a
rollercoaster. Children under 1.2 metres are rejected. The ride starts when
eight children have been accepted.
11
Complete the trace table for the input data: 1.4, 1.3, 1.1, 1.3, 1.0, 1.5, 1.2,
1.3, 1.4, 1.3, 0.9, 1.5, 1.6, 1.0
12
This can either ensure that data consists of a precise number of characters.
A type check verifies that the entered data corresponds to a specific data
type.
A presence check checks to ensure that some data has been entered and
the value has not been left blank
16
Programming Concepts
File Handling
Computer programs store data that will be needed again in a file.
Data stored in RAM is volatile and will be lost when the computer is
powered off.
Data saved to a file is stored permanently, allowing it to be accessed
by the same program at a later date or by other programs.
Stored data in a file can be transferred and used on other computers.
The storage of data in files is a commonly used feature in
programming.
Key point: When writing in a file, the program is outputing the
data to the file, and when reading a file, the program in inputing
the data from the file
There are 3 ways a file can be opened in a program i.e. to write, to read
and to append
19
Library Routines
Creating a Maintainable
Program
Programming Languages
There are many high-level programming languages to choose
from. We will only be treating Python, Java and Visual Basic.
Python is an open-source, versatile programming language that
encourages quick program development and emphasises code
readability. The integrated development environment (IDE) showcased
in this chapter is referred to as IDLE.
Visual Basic is a popular programming language that is extensively
used for Windows development. The integrated development
environment (IDE) featured in this chapter is known as Visual Studio,
which is utilised for capturing screenshots.
Java is a widely adopted programming language utilised by numerous
developers. The integrated development environment (IDE) employed
for capturing screenshots in this chapter is known as BlueJ.
Basic Concepts
When writing the steps required to solve a problem, the following concepts
need to be used and understood:
Sequence
Selection
Iteration
22
Function:
Arrays
An array is a data structure containing several elements of the same
data type; these elements can be accessed using the same identifier
name.
The position of each element in an array is identified using the array’s
index.
There are two types of arrays
Explained in the previous chapter in detail
A two-dimensional array can be referred to as a table with rows and
columns.
26