Instructions from the actual exam (so make sure you read them beforehand...important!):
This is a closed book exam. No aids allowed. This includes, but is not
limited to: electronic devices (e.g., cell phones must be shut off and out
of sight) and computational aids (e.g., any calculators, laptops, hand held
computers, slide rulers, abaci).
DO NOT START the exam until you are told to do so.
For the multiple choice questions make sure that you select the best
answer to each question on the computer bubble sheets using an HB pencil or
darker.
For the written questions write your answer in the space provided.
Unless otherwise indicated you can assume that the programs and program
fragments will translate and run.
Material that you should study
The lecture material: the PowerPoint slides will provide you with an
outline of the topics to be covered. However studying the information just
listed on the slides won't be sufficient to do well on the final exam. You
will also need to take notes in class and to study and understand those notes.
If you have any questions then make sure that you ask me for help and
clarification.
The text book: they should be used as another source of material to help
you understand the material as you prepare for the exam. I won't however
directly examine you on material that is listed in the textbooks that I didn't
cover in class.
Lab exercises and the lab handouts: I won't be directly examining you on
this material (unless it overlaps with the lecture material).
Breakdown of exam questions (by type of question)
10 Multiple Choice Questions
Choose the best answer
Each question is worth 1 mark
6 Written Answer Questions
Q1: Explain Python error for code provided.
Q2: Function that returns a value.
Q3: Function that takes and manipulates arguments.
Q4: Fix code with a logic error.
Q5: Trace code with local and global variables.
Q6: Fill in truth table.
Details about exam topics
Introduction to programming:
The process of creating programs: writing in an editor (no exam
questions on using a specific editor though) to execution
Different types of translators: compilers vs. interpreters
Named constants and variables: declaring, accessing, modifying
(variables). What is similar between a named constant and a variable, what’s
different between the variables and constants
Basic types of variables: int, float, string
How information is stored differently with different types of variables
Displaying output: constant strings, contents of variables/constants,
mixed output
Formatting output with descriptor and escape codes
The importance of good programming style (coding conventions), common
style conventions e.g., naming conventions
What is program documentation and why is it needed
Common mathematical operators, creating/interpreting expressions
Precedence rules: order of operation
Getting user input via: input
Converting between types: int,
float, str
Types of program errors: syntax, runtime, logic
Functions and decomposition: Part I (Part II comes much later in the course
and no notes have been posted yet)
Defining and calling functions.
How to declare variables that are local to a function.
Global variables/constants and how they differ from ones that are local
How to pass parameters into a function.
How to return information from a function.
Good programming style and functions (e.g., self descriptive names,
implements a well defined task, avoid overly lengthy functions)