3GL Program Design - Pseudocode
Question Set 1
1. What is pseudocode?
2. List the arithmetic operators.
3. What does the relational operator <> mean?
4. How does the operator = = differ from the = operator?
5. What is the difference between INPUT and DISPLAY?
6. If X contains 12 and Y contains 10 state whether the following relational
and logical expressions are TRUE or FALSE:
-
X > Y
-
Y < X
-
X <> Y
-
X = = Y
-
X <= Y
-
X - 4 > Y
-
X - 9 = = X - Y
-
(X > 7) AND (X <= 15)
-
NOT (Y = = 9)
-
NOT ((X > 3) OR (Y > 11))
7. Determine what the correct answer is for each of the arithmetic expressions:
-
11 + 7 * 3
-
22 * 4 - 10/2
-
4 * 8 / 2 + 11 * 3
-
40/2/5*10
8. For each of the problems which follow use psuedocode to design a program
and a trace table to test your code:
-
Read characters from the input and count how many letters, how many digits
and how many other characters (not letter or digit).
-
Find the floor area of a house given the width and depth of each room.
Display the total area and total number of rooms at the end of the program.
-
Count the words in a book.
Return to the lesson
and may not be reproduced by any means without the
written
This publication is copyright David Beech and Learning Systems 1997-2002
and may not be reproduced by any means without the written permission of
David Beech.
9 Wyndella Street, Tasmania, Australia
db@codelearn.com