What to expect on the two parts of Exam 1: Paper-and-Pencil and On-the-Computer
Paper-and-Pencil part

What sort of questions should I expect?

The Paper-and-Pencil portion of the exam contains problems in which you:

  1. Trace code by hand, where such code contains function calls, function definitions, and FOR .. RANGE statements.
    • Including functions that call functions that call functions ...
    • And functions that return values
    • And functions that are called multiple times in a program.
  2. Write short snippets of code to do various things, including:
    1. loop according to a pattern with a FOR .. RANGE statement (we may restrict you the the SINGLE-parameter form of RANGE),
    2. construct an object that is an instance of a class new to you,
    3. call methods on such an object, and
    4. reference instance variables on such an object.
  3. Indicate what names (variables) are valid at what places, thereby demonstrating your understanding of scope.
  4. Write a short but complete implementation of a function whose specification you are given.

plus possibly other problems similar to the above.

Do you have a SAMPLE EXAM that I might see?

  • Yes, here is the paper-and-pencil portion of a sample Exam 1.
  • Sorry, no answer key, but we are happy to check any answer for which you are uncertain, or to help you get started on a problem, for the above Sample Exam 1.
On-the-Computer part

What sort of questions should I expect?

The On-the-Computer portion of the exam contains problems just like the ones you have done in your PyCharm exercises. Concepts that will be assessed include (but are not limited to):

  1. Implementing functions that sum (possibly conditionally) or count the numbers in a range that satisfy some property.
    • You are restricted to the SINGLE-parameter form of the RANGE expression.
    • So come prepared to determine how many times the loop must run, and what expression of the loop variable gives the desired sequence of numbers to check.
  2. Implementing functions that call other functions. The functions to be called might be built-in functions, or defined in a library like the math library, or defined in the current module.
    • Wherever practical, you should CALL a function instead of COPY-AND-PASTING its code.
  3. Implementing functions that require iterating through a RANGE expression, with the same restriction to SINGLE-parameter RANGE expressions as in the rest of the exam.
  4. Implementing functions with a specification for which:
    • Its parameters might be numeric or instances of classes defined in the rosegraphics library.
    • You construct new instances of classes defined in the rosegraphics library.
    • The characteristic of those newly-constructed objects may be independent of the parameters or computed by using one or more of the parameters' instance variables.
    • You apply methods to the given and/or newly-constructed objects, e.g. to draw the objects and do other things that methods in the rosegraphics library do for you.
      • Using the DOT trick and pop-up help to learn how to construct objects from rosegraphics that you have not yet seen, and/or apply methods and reference instance variables from objects of classes familiar to you as well as ones new to you.
  5. Same as the previous item, but where the objects that you construct and draw form a simple pattern (and are constructed and drawn inside a loop).
  6. Given a specification of a function, write code that would TEST that function. A test is created by computing by hand or with a calculator the expected value to be returned by the function on arguments of your own choosing, and printing both the expected value and the actual value returned by the function on those arguments.

Do you have a SAMPLE EXAM that I might see?

  • Yes, there is one in PyCharm in your 06-Sample_Exam1-Optional project/folder.
  • Sorry, no answer key, but we are happy to check any answer for which you are uncertain, or to help you get started on a problem, for the above Sample Exam 1.