Knowledge Survey CS 115 Spring 2021

Make SURE you fill in these two blanks!

Your name:
Section:

The purpose of this survey is to ask you to rate your skills at the start of CS 115 and then again at the end of the class. This process can show you what has been gained in the class and can be a guide to the instructors of the class about problem areas. It will have no effect on your grade at all.

Please fill this out carefully. Use the scale given below. It should take only a few minutes. Be as honest as you can in rating your skills in each of the areas below. There is no right or wrong answer. When you finish this survey, click the Submit button at the bottom. We will repeat this survey at the end of the semester and compare answers to see what areas you felt you learned and which you need more work on. You do not have to answer the questions themselves, just give your level of confidence in your ability to answer them. Assume the Python programming language is the one under consideration, if there is a question where that is not clear.

Scale to use

  1. I have no skills in this area.
  2. I would have some idea where to start to attack this problem.
  3. I would have medium confidence that I could make an attempt at solving this problem.
  4. I would have good confidence that I could solve this problem correctly.
  5. I have perfect confidence that I could solve this problem.

Question 1: What are the differences between RAM and secondary storage?
Question 2: Could you zip three files into one compressed folder?
Question 3: Who is Tim Berners-Lee?
Question 4: Describe the difference between a high-level language and a low-level language.
Question 5: There are 3 major control structures in structured programming. Name them.
Question 6: In structured programming, every structure has one _______ and one _______.
Question 7: Indicate which of the following are translated into machine language by the compiler or interpreter:
  1. comments
  2. assignment statements
  3. return statement
Question 8: The line below has a syntax or a semantics error. Which one?
    7y23 = 15
Question 9: Give the value of x after this statement is executed.
    x = 3 + 5 * 4//3;
Question 10: Design an algorithm to travel from your hometown to Lexington (or from Lexington to Chicago if you come from Lexington).
Question 11: Trace this code. Remember you must have areas labelled RAM and OUTPUT.
        var1 = 9.0
        var2 = var1 / 4
        print("var1", var1)
        d1 = 3 * (var2 + var1)
        print("double 1", d1)
Question 12: Fill in the blanks to make a complete program that inputs two integer numbers and outputs their squares.
	def main():
	    num1 = ______ (input("Enter a number"))
	    num2 = ______ (input("Enter a number"))
	    print(_______, num2)
	    print("The square of num1 is ", num1*_______)
	    print("The square of num2 is ", ___________)
	
	________
Question 13: Describe a breakpoint and its purpose in a debugger.
Question 14: Give the output of the following code:
	x = 5
	if 0 < x < 7:
		print("ok")
	else:
		print("nope")
Question 15: How many test cases (at least) would you need to thoroughly test the code below?
	if x > 5:
		print(case1)
	elif x < -2:
		print(case2)
Question 16: Determine for what values of x and y this expression is true and what values make it false
     x > 5 and x < 3 or y == 4
Question 17: Write a program that would solve the following problem:
    Find the sum of 5 numbers input at the keyboard.
Question 18: What's the difference between a counter and an accumulator?
Question 19: What's the output of this code?
	for i in range(0, 10, 2):
		print(i, i + 4)
Question 20: Is this code using sentinel logic? why or why not?
	
	x = 5
	while x != -1:
		x = int (input("Enter a number"))
		print(x)
Question 21: This function is probably a stub or a driver?
def afun (x):
	print(" x came in with ", x) 
	return 1
Question 22: A parameter that represents a _________ data type can only pass information into the function it is part of.
Question 23: What is this statement? a function call or a function header?
    def abc (x):
Question 24: How would you declare a global variable?
Question 25: Given the line below, which of these is true about alpha?
	def proc1 (alpha):
	    ...
  1. alpha could also be the name of a local variable in the function
  2. alpha has memory allocated to it from the start of execution of the function
  3. alpha can be changed in the function so that its new value is returned to the calling function through the parameter list
  4. alpha will be initialized to zero when the function starts
Question 26: Write an expression that will output a random number between 1 and 11 inclusive.
Question 27: Create a list with 15 elements in it. It should be initialized to all 1's. Its name should be values.
Question 28: Which has faster access, an array or an external file? why?
Question 29: Name two different kinds of objects you have used in Python.
Question 30: If you saw the expression, one.two(a, b)
what is the name of the method?
what is the name of the object?
what is a general term for a and b?
Question 31: Describe the basic algorithm of selection sort.
Question 32: List 3 responsibilities that a programmer has to the user of his/her program.
Question 33: Write an integer function called Speed that calculates and returns the fine for a speeding ticket. It has two parameters, one Boolean and one float. The first one (called first) is True if it is the user's first ticket and False otherwise. The second one (called mph) is the speed the user was clocked at. You can assume the speed limit was 55 miles per hour. If this is their first speeding ticket, the fine is $50. If it is their 2nd ticket or later, the fine is $75. If they were going more than 30 mph over the speed limit, the fine is doubled.
Question 34: "I consider myself a "leader" personality." Clicking 1 would strongly disagree with the statement, clicking 5 would strongly agree.