Quiz 5 Review,  CPSC 110,

Some things you should know: 

This is NOT an all encompassing list, but it should help.

  1. Your Name, Your ID, Your Section Number
  2. Recall how to open files for reading and writing.
  3. Know about if and else (may want to recall case statement but not too important)
  4. What is a block of code? Procedure is a block? What about parameters with it?
  5. What is a parameter? What are the types of parameters?
  6. This class is about Problem Solving (in a structured way (using Turbo Pascal) ).
  7. Read, Readln, Write, Writeln are what? How do you use them?
  8. Be able to evaluate Boolean expressions.
  9. What is TYPE? Where is it used in a Pascal program? What does it do?
  10. What are subrange types?
  11. What are ordinal and enumerated types? Give examples.
  12. Enumerated types always have 2 properties: order of their members and names of their members.
  13. How do you declare a variable of a type you just defined?
  14. Understand Loops (Whiles, Fors, and Repeats)
  15. Be able to read and write programs using functions and procedures.
  16. Understand Arrays.
  17. What are arrays? How do you declare them.
  18. What are the parts of the below picture?

  1. Arrays can be accessed sequentially and randomly.
  2. Look at the sorting pseudocode presented on Friday in class (or look at the book’s) or look up Bubble Sort somewhere. Be able to use arrays with it.
  3. Given

VAR

   x : array[1..10] of char;              { yes this really compiles, it’s just a bad way to do it }   .

   i : integer;

And i is initialized to 5.

Which of the following will COMPILE  AND/OR   RUN

a.       x[ i ]  := ‘q’;

b.      x[ i + 12 ] := ‘p’;

c.       x[54] := ‘s’;

d.      x[ i – 5 ] := ‘6’;

e.       and similar

  1. Be able to WRITE A PROGRAM FROM SCRATCH – or at least fill in blanks for one.
  2. Be able to determine the output of a given program – see the book for examples.
  3. Other things talked about in class and/or in lab and/or homework and/or some from the book.