Standard PASCAL   Questions   (28 points maximum – points on left in parentheses)

Due Thursday, 0ct. 12 at start of class – must be printed  -4 if handwritten answers

 

Name ________________________

 

(1)        1. What are the delimiters used to surround an array index?                  [  ]

 

(1)        2. Where do PASCAL array bounds start?                                             Anywhere you like

 

(1)        3.  Is it  necessary to declare all variables in PASCAL?                         yes

 

(1)        4.  Where are subprograms placed physically in a standard PASCAL program?

Before the begin of the main program

 

(1)        5.  Is PASCAL case sensitive?                                                   no

 

(1)        6.  Does PASCAL allow mixed mode arithmetic?                                     yes

 

(1)        7.  Does PASCAL have any reserved words?                                           yes

 

(1)        8.  How many different types of subprograms are there in PASCAL?     two

 

(2)        9.  Suppose you declare a 10 element array of integers, assign values to 8 of the elements and print out all 10 elements.  What happens in your version of PASCAL?  (what version do you have?)

  No error or   1    2    3    4    5    6    7    8    0    0     it’s okay if their numbers are differen

  Free Pascal  2.0.4                            I don’t care what version they have

(2)        10.  Suppose you declare a 5 element array of integer and attempt to print out the 6th through 10th   elements.  What happens in your version of PASCAL?  (what version do you have?)

 No error or   1    0    0    1    0     it’s okay if their numbers are different

Free Pascal  2.0.4     I don’t care what version they have

 

(2)        11.  Does PASCAL allow you to dynamically allocate storage?   If so, how is it done?

Yes

by calling the function  new

 

(1)        12.  What is the PASCAL symbol for the relational operator 'not equal'?   < >

 

(1)        13. In PASCAL, which has higher precedence AND or OR  or do they have equal precedence?

AND has higher precedence

 

(1)        14.  What are the Boolean values in PASCAL?                                        true  false

 

(3)        15.  Give an example of a   declaration of a PASCAL enumerated type?

type fruit = (apple, banana, cherry);

 

(1)        16.  Can you use readln or writeln on Pascal’s enumerated variables?                 No

 

(2)        17. What is the major difference between a FUNCTION and a PROCEDURE

 

A function returns a single value

A procedure returns 0, 1, or many values

 

(2)        18.  How long can an identifier be in your version of PASCAL? What is your version?

Doesn’t seem to care       I tried up to 34 characters and they were okay

Free Pascal                      I don’t care what version they have

(4)        19.  What is/are the method(s)  of parameter passing in PASCAL and what is the difference?    VAR   -  parameters are passed by reference

                        Value  - parameters are passed by copy