Pseudocode
Basics
.
Programming
Agramming1
:
Datar
Typen
:
Numeric ~
Age Quantity
INTELER
,
↑
,
No of
Average Percentage
-REAL
,
Currency
*
Price
,
subjects
Distance
,
Fee , Discount
ASCII
Level , Quality , Grade
Non-Numeric/CHARACTER
-STRING
Address Remarks, Names
-
,
ate/time
Graduated , isFeePaid
BOOLEAN
dd/mm/ yyyy
Variables
X
5
=
compare
TRUET FUSE
comparision statement
,
Admission Date,
AttendanceTime
Assignment operator
:
I
BirthDate
&
X -
F
= 1 v
5-
>
Assignment
Statent
i
↳
Identifier
Y
1
= xv
A
P
U S
g
x - 10
10
DECLARATION :
DECLARE
C
:
INTEGER
Initialisation :
-
Assigning very first value to
declared (created) Variable
newly
Default
initialization
values :
INTEGER
8
RAL
0
CURRENCY
0D
&
CHARACTERS
STRING
↓
.
Goe
-Null
0
StuName -
.
"B"
7"Omer"
↳ Ge
Grade - "B"
StoNamez "Omer"
11
Are initialised
to
a
Null .
BOOLEAN
initialised with
..
Null
#TRUE
TRUE
,
.
HEAL
·
PALSE
.
FALSE
-
istiraduated TRUE
Generally dates
time
are
not
initialised.
if
asked them we use current date
regired
and
to initialise date and time
time
current
.
Admission Date #10-09-201#
BirthDate #10 Sep 2010
,
07/11/2024
17 MOD
Programming
Arithmetic
-
+ -/
operators
C, Y , 2 :
DIY
=
8 5
·
,
↳
-
*
Y3
Aisk
2
(3
Mob
-x +
y
Expression
Superscript
zor
2 -
27
2-
x
-
y
~ Absolute
x/y
UDY
,
zUTY
Subscript
223
2
2
*
Y
---
8 > DN
-
17/2
17
.
DN
2
MOD(x Y)
,
2 DIV
(kiY)
MOD and DIY
functio
n.
17
25
8 5
MOD 2
17
2 -
=
N
INTEGER
(4- 7
210
2
:
*,
,
↑, MOD ,
DECLARE
17/2
17 DIV2 = 8
2:
Operators:
2= 1
as
=
=
16
1
-
8
I
-
2-
CMODY
2
UDNY
MOD
Logical operators
↳
=
Equal to
X
less than
X=
Less
If
on
>
-
**
not
x =
Y
IFxxy
equal to
IF
greaten then
greate then or equal to
>
F
than
:
equal to
(=
Ifx
Bookan Operatus :
<Y
DECLARE
IF
AND
MYOP : BOOLEAN
Y
OR
Y
y
OR
NOT
X
myOp
E
myOp
FALSE
NOT TRUE
myop
<
NOT
NOT
FALSE
FALSE
TRUE
(UDY)
(7-3)
NOT TRUE
-
x =- 7
Y
(y <+3) And (x > Y)
myopa
<3
& true
<
T
2
myopz (3 + > a)
E
(5
True
[
>
E
AND
T
Or
(y < (15-2)
(3 = 13)
OR
T
7)
Variables
are
constants
are
DECLAREidentifiers :
changeable.
fixed .
CONSTANT
CONSTANT
A
PAV"
Pic 3 14)
.
2
Declaration
# p2
42
VARIABLES
-
-
-
-
-
<2
DATA TYPES
-
&
CONSTANTS
-
DECLARATION
Initialisation
-
-
-
logical
Y
Boolean
I
camelcase
·
PascalCase *
My Home Addres
my Home-addres
-
Naming Conventions
Arithmetic Operators
Y
Identifier :
·
Identifiers
Literals-
Assignment
Operators
-
Xtyper
cidentifies = XXaWes
I
-
myName
your Nave
Addres
Grade
this
propia
TheirAge
.
I
Naming Conventions
-
(aig) (A-2) (0-9)
1
.
Only alphabets digits
,
and
underscore
2 Cannot start with digit
Al- 1AX
3 No
Special Characts
-
.
.
: NO
4
:
keywords
.
Literal
Theirtge 15
'D'
Narezzar
MyGrade -
COUNTING
Adding
A
+
to the
1
previous value
5
+ 1- Counting
d
~
A1 +
-
A B + 1X
-
At 5
-
A A +B
X
·
Totalling
D5
:
A
-
18
c + 2
#- A + D
-
Unknown (Variable)
Value
At D + A
A + B + DX
At C + Av
-----
Programming Practices
Good
*
Use
:
meaningful identifiers.
declared constants
code with comments
* Annotate
·
use
*
Make
a
Use
of
indentation
Split code into Subroutines
(functionsI
procedures (
IF
-
·
-
ENDIE
FORX-
E
-
NAT
-------
rification
dation
Rest
:
Erification
:
Manual Data
Verification
&
Digital
EntryDouble Fea
checksum
.
Bien/old parity
Parity
- Device 2
.
Mich>
Protocol
Sander
-
-
applies
Only
Used in closed
Even
&
-
Receiver
on
Cheekson
01 Gain
Drop
1-30
to ASCII
used
A
proximity
6501000001
B66 %loo oo 10
non-reliable
communication channels.
C
s in Byte
Parity
~
67110 0
0 0
:
When I bits
-
-
-
Block
Gain
Parity
are :
swapped
Drop
.
1 Block/Byte Parity
Check:
Purity
-
Parity
Date Transmission -
A
01000001
B
010000
C
11000011
11000000
Parity
Byte
-
*
10
*
11
A checksum is a small sized dater itematum)
derived from a blockI digital date (binary)
Checksum :
for
purpose of detecting errors that may have
been introduced during its transmission
the
.
Receiver
Sanche
n
* 265
01000001
B =66
01000010
C267
01000011
Fas
11000110
/
When
*
.
is transferred
the data
it may be
changed for
.
is called
"corrupted
Changed data
corrupted dater either the Dits are gained dropped.
certain
In
is verified
applied
to block
TransferableBlock
Checkson
&
Checksum
reasons
-
or
found and
For
checksum datum is
attached to the block.
0- 1
Gein
1to
Drop
Dater is sent in blocks
*
An additional value is also sent
Nake is called checksum .
·
Receiver re-calculates the
checksum and matches it
·
with the received chedsai
9/1/zu.
Routines :
ry
~
ROUND
(sidentifiers , places (
UK 3 7532
.
y ROUND (x 2)
3 75
.
,
Y ROUND (KIA)
3 8
.
RANDOM((
<
ROUND
(RANDOM))
*
VB ,
LB)
DiceVal < ROUND (RANDOM(( *6 , 1)
IEROUND (RANDOM)) 170 , 50)
9
The end
Pseudocode
/ between 50 AND70
Basics
Constructs
FOR
N
1
TO
-
10
O
-
Sequence
-Selection
NEXT
-
-
IF
-
-
CASE OF
IterationLoop
Count
Controlled
(FOR
... NEXT)
-
·
Post
REPEAT
...
-
UNTIL
Condition
Based
Pre
-
-..
WHILE
ENDWHILE