|
|
|
|
eXercise #1
Introducing Pascal
Syntax
- Which of the
following would NOT be acceptable as identifiers
(if not, why not):
- last
- end
- 3rd_name
- the radius
- interger
- $1.00
- b/2a
- whyNot?
- <length>
- a_long____andPointlessName
- begin
- ten%
- Given the following
fictitious syntax definition:
a thingo
is defined as: letter digit [digit {digit|underscore}]
- Determine
whether the following thingos are legal
- e4
- DD1_4_3
- U2222_222
- T66
- Write 3 different
legal thingos by yourself
- Referring to
the following unit:
Procedure TForm1.button1click(sender:TObject);
{this is my first real program
var x = real, y=interger;
begin
x = 2.5;
y = square[x]
showmessage('x = ' + strtoint(x));
outputbox('y = ' + y)
end
Re-write it so
that it is free of LOGICAL and SYNTAX ERRORS
- Distinguish between a LOGICAL and a Syntax error - give an example
of each to clearly show you know the difference
- Explain, briefly, the difference between COMPILED languages and
INTERPRETED languages.
- Delphi/Pascal is said to be a THIRD GENERATION language - what are
the other generations (with examples) and describe briefly how the
generations differ.
|
|
|
|
|
|
|