Topics Final CS112 – Spring 2009
Check for updates… this document will most likely be updated a few times!
Last update: 4/26/09 5:15 PM

- Everything from the 1st midterm... the final is cumulative and will cover the entire semester! Check that review also!

Python basics

Datatypes
Loops/Decisions
Functions

Pickling and Shelves
Graphics and GUIs

Objects/Classes


Errors (if we get to this in class)
-    Know how to identify and define these error types:
        o    syntax - incorrect syntax due to spelling errors, missing operators, etc. ,
        o    run-time - compiled/interpreted, but crashes when encounters certain data sets
        o    logic errors - executes, but provides incorrect or inconsistent outputs

Debugger (if we get to this in class)
-    What is step versus next versus out
-    What is a breakpoint?
-    Debugging is the process of finding and fixing problems in programs. Know that

- Exceptions (if we get here in class)
    - Know the try/except format and how to write it
    - Know what happens with an 'except:' block
    - Know what happens with multiple except blocks
    - Know how exception propagation works

Remember to bring a scantron!!!

How to Study
Some help in my opinion for how to study. First: Start EARLY! Many studies show studying a little over a long period of time is much better than studying a lot right before the test!

1. First, make sure you understand fully the previous midterm. Do this by HIDING the answer from yourself (cut some paper and tape it over your answers), and then re-answer the questions... did you miss any? Try writing the answers in IDLE and seeing what happens.

2. Make sure you understand the items on this study guide - Work through examples on the slides and the projects/labs. Make sure you can write the code... don't just read and it and assume you know it. It's a lot different to read code than it is to write code!

3. Do as many practice problems as you can from the labs/projects/book... work on understanding the concepts and the syntax. Try to fix errors when they occur.

4. Ask questions if you don't understand something. Post questions to Blackboard for things you don't understand. Email me or the TAs also if you need help.


Some sample programming problems to practice
  1. Write a function to find the most common number in a list of numbers passed into the function
  2. Write a function that takes a list of number and returns a count of how many times a number repeats in a row.
            For example:
                    Input: 23224233345542    Output: 4
                    Input: 555                          Output: 2
                    Input 5515                         Output: 1
  3. Write a function that finds the largest and second largest number in a list. Do this WITHOUT using the sort function. Return both values from the function
  4. Write a program that displays the text of a button if you place your mouse over the button (but do not press the button)
  5. If we get to exceptions: Write a function that can capture multiple types of exceptions -- NameError and ZeroDivisionError and then all other exceptions. Take input from the user that could make any of those happen, and print out a specific error message when any error occurs