Programming Language Project

Question Set #6

Due: November 23, 2004 at start of class

Answers MUST be keyed in before printing

 

Name Christopher Payne               Programming Language Object Oriented Turing

 

Note:  For each of these question sets, you should look first in the reports you were given.  You should then check the information on the Web or in a book.  If the information is not in the report, you should say so and then find it on the Web or in a book.

 

1.        Attach the source code for a short program that you have interpreted/compiled and run.  The program does not have to achieve any meaningful task but must include statements illustrating 3 additional answers from question set #2 (the answers to questions 6,7, 8,9, and 10 that you didn't already illustrate in question set #4).   It must include line by line comments identifying the type of statement AND the requirements for the statement.   Circle the type of statements you are illustrating.

a.       Assignment

b.       Selection

c.       Iteration

d.       Input

e.       Output

 

2.       Capture the output produced by your program (screen capture).  Print it and attach it also.

 

3.       Does your language provide any exception handling mechanisms?

                   Yes. 

                           handler(id)

                              [statements]

                           end hanler

                   This was not in  the book.  It was in the Reference Manual.

4.       If it does, provide a description of what happens on erroneous input.  If it doesn't describe what happens when on erroneous input.

                  When Turing encounters an error control jumps to a handler routing.  The handler routine returns an id number. Within the exception handler

            you can have a block of statements.  After executing the statements inside the block control returns to the calling procedure.

 

     

5.       Can the user define their own exception handlers?

                  No.

            This was in the report.

                 

                 

6.       What types of subprograms does your language have (i.e. functions, procedures), if any?

       Turing has functions and procedures.   

       This was in the report.

 

7.       What is the parameter passing mechanism in your language?

        By default parameters are passed by value. If you declare a parameter using the word ‘var’ then they are passed by reference.

 

     Example of by value:  procedure x(age : int)

 

     Example of by reference:  procedure x(var age : int)

 

       This was not in the report. Found it in the Turing Reference Manual.

 

8.       Does your programming language allow recursive calls? 

Yes.