CPSC 231: Midterm Information
(I will add information here as we get closer to the exam so you should check
back here for updates)
Date/location:
- In class midterm
Friday March 2
during normal class time
Review material:
- During lecture as I cover the material I have provided suggestions of what an
exam-like question may look like. You should attend class for this info and note
the details as it comes up.
- In class midterm review: although I go over exam-type questions during
the semester, in the lecture just before the exam (Wednesday February 28) I will
take some time out of class to go over some sample exam questions.
- Extra-extra review questions: They are meant to provide you with some
extra practice so you need to actually try them on your own to get anything
out of it. For that reason, solutions won't be posted and I won't just
"email you the solutions". But it really shouldn't be a big loss because I
have taught you how you can find out the answers for yourself:
- For the 'tracing' questions where you have to determine the output
of a program then you can always type in the program or expression and
run it yourself. (Copy and paste works well out of PDF files).
- The 'writing' questions (e.g. write a query or write a program) are
a little trickier but you can still check your answers by testing the
results e.g. does your program produce the results specified in the
question.
- If you are still unsure of things after you have attempted a
question (e.g. you can't figure out why you got a given result after
typing it in and running the program), then you can ask (just be sure to
show me the work that you have done so I can see how far that you have
gotten and perhaps where you are having problems). Again don't just
coming in cold without making an attempt.
- Link to [Extra-extra review
questions]
- Still want more practice questions? Try working through the sample
problems in the bookstore textbook!
- Finished all the textbook problems and want still more? Try working
through practice problems in the (Python v3.X) textbooks that you can
find via the
UC-Safari website. (Note that I haven't personally vetted the
textbooks for quality or match for CPSC 231 so you will need to do that
beforehand).
Instructions for the day of the exam (instructions that you should follow
when you enter the room before you start writing)
Front cover with actual exam instructions (so make sure you look at this
beforehand)
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.
- Text books: can 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.
- Tutorial exercises and the tutorial handouts: I won't be directly examining you on
this material (unless it overlaps with the lecture material, the exception
is the material on UNIX would you got to apply in A1 and the generation of
random numbers).
Lecture topics (exam review)
Introduction to programming
- Creating, translating programs into binary/machine language and
executing programs
- Variables: declaring, assigning values, accessing, naming
conventions
- Named constants: difference from variables, naming conventions
- Common arithmetic operators, order of operation
- Print(): displaying string vs. memory
(variables, constants) output, format specifiers, escape codes, triple quoted output
- Input()
- Functions that convert types: int(),
float(),
int()
- Strings: concatenation
- Program documentation: inline and
header
- The three types of errors: syntax,
runtime, logic. How they differ, when they occur, examples of each
- Random number generation:
random.randrange()
(Tutorial example)
Decision making
- Branching structures: IF,
IF-ELSE, IF-ELIF
and multiple IFs
- Logical operators: AND, OR, NOT (logical expressions formed inside
of Python programs and formed outside of coding e.g. truth tables and
the other layouts covered in lecture)
- Nested branches
- Minimum test cases for decision making structures
- Drawbacks of floating point variables and the use of an Epsilon
Repetition
- Categories of looping structures: pre-test, post-test
- FOR loops, WHILE
loops
- Examples of counting loops: single increment, decrement,
increments/decrements in values other than one
- WHILE loops that don't update by a
additive amount (e.g. increase by a product)
- FOR loops that iterate through strings
-
Erroneous loops: never end, never run
-
Sentinel controlled loops
-
Nesting: nested loops, branches nested in loops,
loops nested in branches
-
Minimum test cases for loops
-
Usability Heuristics
Exam topics
Lecture topics covered so far
|
Approximate proportion of exam1
|
UNIX commands |
~6% |
Intro to the course/administrative notes |
6 |
Introduction to programming (excludes data representations material, I
did talk about ASCII character representations in a later section) |
22 |
Branches |
32 |
Repetition |
~32% |
Decomposition |
Not on midterm |
Again: You are expected to be familiar with common functions that have been covered
in class such as: print(),
input(), int(),
float(), str(),
randrange().
Exam questions1
Multiple choice questions 23 marks
|
|
|
Short answer questions 8 marks
|
|
There will be one short answer code writing question |
1 It's based on a near-final version of the midterm (exact proportions may
vary *slightly*