HOMEWORK assigned August 26, 2004

 

 

 

 

 

What do we need to know to write a program in a new language?

 

 


We distinguish between key words and reserved words and pre-defined terms

 

Reserved words can only be used in the way that they can be used (eg. They can not be used as variaboe, function or class names)

Keywords have a special meaning when they are used in a particular way but can be used as variable names, functionnames, class namesl

Pre-defined terms have a meaning in context but that mean can be superseded by the programmerl  If it is, the original meanin is lost.

 

FORTRAN has no reserved words

 

Early FORTRAN was a column oriented language

Original FORTRAN only used upper case letters

Variables had at most 6 characters – first character had to be alphabetic – subsequent characters could be alpha numeric

Spaces in variable names were ignored  

 MOTHER  M OTHER   M O T H E R

          Punch cards had 80 columns

          Column 1 held a comment indicator – C or !

           Columns 2-5  were for numeric labels

          Column 6 indicated a continuation card –

          Columns 7-72 were for FORTRAN statements

Columns 73-80 used to properly sequence the lines of code in the program

           Statements do not have to be numbered

          Numbered statements do not have to be in order.l;

         

 

 

Don’t have to declare them

If they begin with A-H or O-Z  they are real numbers

If they begin with I-N they are integers

Logical data had to be declared

There was no character manipulation (I;e; string manipulatipon)

There were two logical values  .TRUE.   .FALSE.

You could override the default declarations for integers and reals with explicit declarations

 

What is the assignment operator- if any?

       =

 

 

What arithmetic operators are there?

+  -  *   /   **  IFIX( )   SQRT ( ) , etc.

 

4 Branching statements

 

1 Looping

      DO  10   I – 1,5, 1

           ……

           …..

10 CONTINUE