CS 1110 - Introduction to Programming

Review for Fourth Test

The following questions are provided to help you study for the fourth test. Do not expect to see these exact questions on the test.

  1. What are some common sources of errors in programs?

  2. What do indentation rule require you to do with respect to logic structures?

  3. Where are colons used in python programs?

  4. How is a subclass linked to the superclass that is is based on?

  5. How does a UML chart of superclasses and subclasses different from one that only shows classes?

  6. What kind of polymorphism exists in every subclass?

  7. When does the isinstance() function return True? Why might this not be as informative as we might hope?

  8. What is recursion? How is it different from looping? How is it similar?

  9. What are the two cases we should identify when planning a recursive function?

  10. How can we make sure that a recursion is not infinite?

  11. Write a recursion that prints a countdown from 10 to 0.

  12. Write a loop that prints a countdown from 10 to 0. Which one did you prefer writing?

  13. Why might it be easier to notice direct recursion in a program than indirect recursion?