Here is a general outline of the key concepts and commands (arranged by topic) that you should know for the midterm.
The exam will have the following sections:
Definitions (5 Points)
Hardware (5 Points)
Information Representation (5 Points)
Conditional Execution (5 Points)
Repeated Execution (5 Points)
Algorithms (5 Points)
Data Structures: Lists (5 Points)
Data Structures: Dictionaries (5 Points)
Each section will consist of a mixture of multiple choice / select all, fill-in-the blanks, matching, ordering, or short answer type questions. For the most part, these questions will resemble the types of questions asked in your Reading quizzes.
This check list is meant to be representative, rather than exhaustive (ie. there may be questions that show up on the exam that are not shown below).
You will need to know the definitions of the following terms:
Program
Programming Language
Assembly Language
Interpreter
Variable
Expression
Function
Integer
Floatin Point
ASCII
Cache
Pipelining
Multi-core
Exception
Pseudo-code
Complexity
Infinite Loop
Process
File System
Image
Pixel
Patents
Copyright
Trade secret
Trademark
Identify the term that corresponds to the following definitions:
The standard encoding used to represent letters or text.
An abstraction provided by the operating system to store data on secondary storage.
You will need to know the following:
What is a computer?
How is a computer logically constructed?
What is the role of the CPU, RAM, Disk, and I/O devices?
What sort of operations does a CPU support?
What is the execution model of a CPU?
Identify the hardware components best described by the following:
As the brains of the computer, it performs the core operations of the machine.
This provides fast but volatile storage of data.
This provides slow but persistent storage of data.
This type of component includes devices such as keyboards and mice.
This type of component includes devices such as monitors and printers.
You will need to know the following:
What is the difference between analog and digital information?
How do you convert a number from decimal to binary? hexadecimal? vice versa?
What is the difference between KB
, MB
, GB
, TB
?
How are colors represented on a computer?
Convert the following binary number into decimal and
hexadecimal: 1010
How would you represent the color black in hexadecimal? white? red? green? blue?
You will need to know the following:
What are boolean expressions?
How do we perform conditional execution? alternative execution? chained conditionals?
Given the following code:
if x > 5:
print('Yes')
elif not x % 2:
print('Maybe')
else:
print('No')
What is printed if x
is 5?
What is printed if x
is 10?
What is printed if x
is 3?
You will need to know the following:
How do we perform repeated execution based on a condition?
How do we perform repeated execution over a sequence?
The Python code below is suppose to count all of the even numbers
between 1
and 100
(inclusive) that are also a multiple of 5, but it
contains some errors. Identify and fix the errors:
i = 0
while i < 100:
if i % 2 or i % 5:
total + 1
print(total)
Convert the program above from using a while
loop to using a for
loop instead.
You will need to know the following:
What is an algorithm?
How do we measure and evaluate time complexity?
What is the time complexity of linear search? binary search? sorting?
Given the following code:
def function(data):
for i in range(1, len(data)):
if data[i - 1] > data[i]:
return False
return True
What is the result of executing function([1, 3, 4, 7])
?
What is the result of executing function([0, 6, 5, 2])
?
What is the time complexity of this function?
What is this function doing (one sentence description)?
You will need to know the following:
What is a list?
How do we construct a list?
How do we access an element in a list?
How do we iterate through a list?
How do we search a list?
How do we slice a list?
How do we add to a list?
How do we sort a list?
Given the following code:
numbers = []
for i in range(10):
if i % 3 == 0:
numbers.append(i)
What is the contents of numbers
after the for
loop?
How would you get the amount of items in numbers
?
How would you get the first item in numbers
?
How would you get the last item in numbers
?
How would you get a sublist of numbers
that skips the first item?
You will need to know the following:
What is a dict?
How do we construct a dict?
How do we access an element in a dict?
How do we iterate through a dict?
How do we search a dict?
Given the following code:
text = 'Billy bob'
counts = {}
for letter in text:
if letter in counts:
counts[letter] += 1
else:
counts[letter] = 1
After executing the code above, what is the result of the following expressions:
len(counts)
counts.keys()
counts['b']
counts['i']
counts['t']