Professional Documents
Culture Documents
Paper2 Theory
Paper2 Theory
Slow
Require interpreter or compiler
Can’t directly control the machine
Harder to understand
Hard to debug
Machine dependent
Interpreter
Translate the program line by line
Do not generate executable file
Slow
Easy to debug
Interpreted program--- need the interpreter
Assembler
Translate assembly language to machine code
Mnemonic code
Variable
To store the value, that can be changed
Constant
To store the value, Can’t change
Global variable
Declare outside the scope
Can be accessed from any part of the program
Local variable
Declare within the scope
Can access within the scope
Error
Logic-incorrect result
Syntax-incorrect spelling, missing value
Run time- execution time(divide by zero)
Test data
Normal test-----within the limit
Boundary test------max and min
Erroneous test-----outside the limit
Eg. mark-----0 to 100
Normal ------ 70,90
Boundary ----- 0,100
Erroneous ----- -5,120
Iteration-loop
for- count control loop --- definite time
while- precondition loop --- 0 or more
repeat until – post condition loop --- at least 1
Relational operator
> < >= <= == !=
Logical operator
And or not
Parameter
To assign the value to the function
To reuse, to save the memory
Function
To group code
To reuse
Easy to maintain
Maintainable program
Comments
Meaningful variable name
Function
Algorithm
Step by step instruction to solve the problem