Description: Description: Description: Description: Description: Description: Description: Description: Breaking News! Click here for details.

 CSC 131 - Introduction to Computer Science

Midterm 1 Study Guide

The actual exam will be a subset of below:

WRITTEN PROBLEMS

1.     Chapter 4: Vocabulary Words: mutable, immutable, list vs. tuple, sequence.

2.     Chapter 4: Know the weirdness about declaring a tuple with a single element (see section 4.2.2).  

3.     Chapter 4: Know the typical list operations: accessing a single list element, slicing a list, append, insert, len, delete, traversing a list using a for loop, traversing a list using a while loop.

4.     Chapter 4: Know the difference between assigning a list and copying a list.  In other words, what’s the difference between list2 = list1 and list2 = list(list1)?

5.     Chapter 4: Be able to trace a snippet of code that traverses a single dimensional list and performs some calculation.

6.     Chapter 4: Be able to trace a snippet of code that traverses a 2D- dimensional list and performs some calculation.

7.     Chapter 4: Know how to evaluate some simple list comprehensions as in Figure 4-15.

 

8.     Chapter 5: Vocabulary: functions, invoking a function, function header, function body or suite, formal parameters, actual arguments, value-returning functions, non-value returning functions, variable scope, local vs. global variables, variable lifetime. 

9.     Chapter 5: Know the syntax for defining a function with a certain number of arguments.

10. Chapter 5: Know what a non-value returning function actually returns.

11. Chapter 5: Be able to trace code that performs one or two function calls. (Problem 6 at the end of Chapter 5 is pretty good practice problem.)

 

12. Chapter 6: Vocabulary: Objects, attributes (instance variables), behaviors (methods), dot operator, reference, dereferenced value, memory deallocation, garbage collection, turtle graphics, absolute positioning, relative positioning.

13. Chapter 6: Know what the id function does.

14. Chapter 6: Understand why a “shallow” copy of a list is different than a deep copy of a list. 

15. Chapter 6: Understand the coordinate system of turtle graphics. (0,0) is in the middle, etc. 

16. Chapter 6: Know how to move a turtle both in terms of absolute positioning as well as relative positioning. 

 

17. Chapter 9: Vocabulary: dictionary, key, set.

18. Chapter 9: Know how to create an empty dictionary and an empty set.

19. Chapter 9: Know how to add and retrieve items with a dictionary.

20. Chapter 9: Know the different set operators (see Figure 9-10).

 

21. Chapter 11: Vocabulary: Recursion, base cases, infinite recursion,

22. Chapter 11: Be able to trace the execution of a recursive function. 

 

For the written portion, you may bring in 1-sheet of paper (8 ½ x 11 inches) with whatever notes you want on it.   Otherwise, this written test is not open book nor open-internet.  

 

PROGRAMMING PROBLEMS

1.     Implementation: A Python program of similar difficulty to the problems in Homework 6.  Related book problems would include P1-P7 at the end of Chapter 4, and book problems P1-P8 at the end of chapter 8. 

 

 

2.     Implementation: Write Python program of similar complexity to Programs 1-3 on Homework 7.  Related book problems include P1-P7 at the end of Chapter 5.    

 

3.     Implementation: Write a Python program using Turtle graphics to display some simple graphics similar to what is required for book problems P1-P6 at the end of Chapter 6. 

 

4.     Implementation: Write a recursive program similar to the complexity of Program 2 or Program 3 in Homework 9.   Some related book problems are P1-P7 at the end of Chapter 11. 

 

 

For the programming portion, you may bring in 1-sheet of paper (8 ½ x 11 inches) with whatever notes you want on it.   You may use your textbook (either paper or electronic version).  However, you may not use any other internet resources.   No internet searching!