Your first real Delphi programs: declaring variables, reading input, doing arithmetic, and displaying formatted output. Everything later in the curriculum sits on top of these.
A console program has a fixed shape: a program header, an optional uses clause, a var block declaring every variable up front, then the statements between begin and end. Note the full stop after the final end.
Example
program Main; {$MODE DELPHI} uses SysUtils; var name: String; age: Integer; average: Real; begin WriteLn('What is your name?'); ReadLn(name); WriteLn('Enter your age:'); ReadLn(age); average := age / 2; WriteLn('Hi ', name, ', half your age is ', average:0:1); end.
| Type | Holds | Example |
|---|---|---|
| Integer | Whole numbers | age := 17; |
| Real | Numbers with decimals | price := 149.99; |
| String | Text of any length | name := 'Thandi'; |
| Char | Exactly one character | grade := 'A'; |
| Boolean | True or False | passed := True; |
💡 Exam Tip
Forgetting the :0:2 on a Real is the single most common reason a correct calculation is marked wrong — the memo expects 9.40, not 9.4000000000E+00.