CS110 Midterm Review


The following are the topics covered in the first part of Introduction to Computing. The material will cover chapters 1 through 4 of Introduction to Computer Science via Robots and chapters 1 through 3 of Programming Python.

Topics


Detailed Topics


Sample Questions


  1. Write a function to convert MPH to inches per minute.
  2. What does the following code do?
    # 1.
    for i in range(input()):
        print "X"
    
    #2. 
    def function(x):
        for i in range(x):
            for j in range(i):
                print "*"
    
  3. Short answer: what is recursion? Give an example.
  4. Matching: match the Python code with the following ideas:
    x = 1loop
    for i in range(12):
        print "hello world!"
    
    assignment
    x = x + 1
    
    increment