Programming is the process of writing instructions for a computer to execute. It involves using specific syntax and logic.
INTEGER
: Whole numbers (e.g., 10
).REAL
/ FLOAT
: Numbers with decimals (e.g., 3.14
).BOOLEAN
: Either TRUE
or FALSE
.CHARACTER
: A single letter/symbol (e.g., 'a'
).STRING
: A sequence of characters (e.g., "Hello"
).INPUT
: Gets data from the user.OUTPUT
: Displays data to the user.ASSIGNMENT
: Stores a value in a variable (score = 0
).These dictate the flow of your program:
IF / ELSE
to choose paths.FOR
loops: Fixed repetitions.WHILE
loops: Repeat while condition true.REPEAT...UNTIL
: Always runs at least once.OPEN
, READ/WRITE
, CLOSE
files.
FUNCTION calculateArea(radius)
PI = 3.14159
area = PI * radius * radius
RETURN area
ENDFUNCTION
INPUT "Enter radius: " TO userRadius
circleArea = calculateArea(userRadius)
OUTPUT "The area is: " & circleArea
Debugging means finding and fixing errors: syntax, logic, or runtime. Following good coding standards (clear names, comments) makes programs easier to read and maintain.