SELF TEST
Click here for a FORMS compatible inter-active version of this test

1. Write a Pascal statement to define an array called numbers, which is an integer array with elements ranging from 1 to 20

2. Write a Pascal statement to create an array called mynumbers, of type numbers, which was defined in 1. above

3. Write a Pascal statement which assigns the integer value 20 to element 4 of the array mynumbers, which was declared in 2. above

4. Write Pascal statements which define a packed array of characters (15 elements), called word, create a working variable of type word called myword, and then reads input from the keyboard into the array myword

5. Write Pascal statements which will sum the contents of an integer array called mynumbers, which has 20 elements numbered 1 to 20

6. Write a Pascal statement which will initialise a packed character array called message to the string 'Hello there!'. The array has thirteen elements

7. Write a Pascal statement to display the ASCII value of the letter 'A'

8. Write a Pascal statement to display the character represented by the ASCII value 52

9. Write a Pascal statement to display the character which follows 'F'

10. Write a Pascal statement to display the character which comes before 'Z'

Answers


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