Information about the midterm exam
(More details will be added later as I get the time).
Date/location:
- Thursday October 28 in ST148 from 6
- 8 PM
Review questions:
-
Some written questions (for the midterm don't worry about the question
dealing with ASCII representations).
-
I will also go over some review questions in the Wednesday lecture just
before the exam. [Questions]
-
Additional resource: Feel free to look at the links that Nathaly Verwaal has
up about the midterm (because it's a common midterm), look under the week of
October 26: [Additional
resources]
Instructions from the actual exam (so make sure you read them beforehand):
- This is a closed book exam: No electronic devices (e.g., cell phones must
be shut off and out of sight) or computational aids (e.g., any calculators,
laptops, hand held computers, slide rulers, abaci) will be allowed. This
includes ‘simple’ calculators.
- 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. Any syntax or run-time errors are
unintentional unless it is clearly stated in the question that such an error
could exist in the code.
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 books: 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
14 Multiple choice questions (14 marks total)
- 8 questions from the notes: Introduction to
programming
- 4 questions from the notes: Branching and
making decisions
- 2 questions from the notes: Introduction to
functions and problem decomposition
6 Written questions (30 marks total)
- Q1: Program writing, branches (6 marks)
- Q2: Program writing, branches (4 marks)
- Q3: Program tracing, functions, parameter
passing, local variables (5 marks)
- Q4: Logic (decision making notes),
evaluating a logical expression specified in a truth table (6 marks)
- Q5: Analysis, precisions errors related to
floating point or real numbers (4 marks)
- Q6: Program trace, recursion (5 marks)
Note: although it's not explicitly mentioned the program writing or program
traces will likely involve the use of output (via '
print')
and possibly input (via 'input'
and 'raw_input')
Topics
Introduction to programming:
- The process of creating programs (writing in an editor 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
- Displaying output: constant strings, contents of variables/constants,
mixed output
- 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 and
raw_input
- Converting between types: int,
float, str
- Types of program errors: syntax, runtime, logic
Functions and decomposition: Part I
- Defining and calling functions
- How to declare variables that are local to a function.
- How to pass parameters into a function.
- Good programming style and functions (e.g., self descriptive names,
implements a well defined task, avoid overly lengthy functions)
Branching
- Branching constructs: if,
if-else, if-elif-else
- Applying the logical operations: AND,
OR, NOT in conjunction with
branching
- Evaluating truth tables and logical expressions e.g.,
(True AND False)
OR (True), evaluating truth tables
Recursion
- Knowing what is a recursive function, what are the requirements for
recursion to be used sensibly.
- Similar to the other sections you should be prepared to either write or
trace relatively simple Python programs that employ recursion (e.g., the
'head' and 'tail' examples that I covered in class but not the 'maze'
example)
Topics that won’t be on the exam:
- the administrative notes,
- Functions and decomposition Part II,
- Loops and the sections that follow
- QuickDraw