Introduction
PASCAL is a programming language named after the 17th century mathematican Blaise Pascal. Pascal

Strict rules make it difficult for the programmer to write bad code!

Basic format of every Pascal program
Every Pascal program has the same essential format, which is illustrated below,


	program TITLE ( input, output );
	begin
	  program statements;
	  program statement
	end.

program is the first word of all Pascal programs. It is a keyword (Keywords are reserved, ie, you cannot use keywords to describe variables).

TITLE is the name the programmer gives to the Pascal program being written.
It is an identifier. Identifiers begin with a letter, then followed by any digit, letter or the underscore character ( _ ).


Question time. Which of the following are valid Pascal identifiers?
	 birthday     Too_hot?        First_Initial
	 grade        1stprogram      down.to.earth
	 see you      OldName         case

Click here for answers
(input, output) states what the program will do, ie, input and/or output data. Data is inputted from the keyboard, and outputted to the console screen.

begin defines the starting point of the program, and provides a means of grouping statements together (ie all statements between a begin and end are considered part of the same group or block).

program statements are commands or instructions to the computer which perform various tasks.

end. This must always be the final statement of a Pascal program.

ALL PROGRAM STATEMENTS AND LINES ARE TERMINATED WITH A SEMI-COLON, EXCEPT THE BEGIN AND END KEYWORDS. PROGRAM STATEMENTS PRECEEDING AN END STATEMENT DO NOT REQUIRE A SEMI-COLON.


Copyright B Brown/P Henry/CIT, 1988-1997. All rights reserved.

1