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:

  1. X > Y
  2. Y < X
  3. X <> Y
  4. X = = Y
  5. X <= Y
  6. X - 4 > Y
  7. X - 9 = = X - Y
  8. (X > 7) AND (X <= 15)
  9. NOT (Y = = 9)
  10. NOT ((X > 3) OR (Y > 11))
7. Determine what the correct answer is for each of the arithmetic expressions:
  1. 11 + 7 * 3
  2. 22 * 4 - 10/2
  3. 4 * 8 / 2 + 11 * 3
  4. 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:
 
  1. Read characters from the input and count how many letters, how many digits and how many other characters (not letter or digit).
  2. 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.
  3. 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