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

1. Write a for loop to display the following output

	1 2 3 4 5 6 7 8 9 10

2. Write a for loop to display the following output

	1
	22
	333
	4444
	55555

3. Write a while loop to display the following output

	A B C D E F

4. Rewrite the following if statements as a Case statement

	if flag = 1 then number := 10
		else if flag = 2 then number := 20
			else if flag = 3 then number := 40;

5. Define an enumerated data type called chair, which has the set of values lounge, deck, executive

6. Write pascal statements to define a new working variable mychair, of type chair, and assign the value deck to this new variable.

7. Define a new subrange called minutes, which has a set of ranges from 0 to 60.

Answers


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

1