Possible test question types
Oct 4, 2011
CSE 1310-004 (Tiernan)
Below are examples of the kinds of questions I might ask on an exam. Try to work through these and then we can discuss your answers on Thursday in class if desired. I will not do a review for the test so your questions on Thursday will be your opportunity to find out about the test or to explore what I am looking for in regard to these questions.
A. Given the Python code below
Def uber(wald)
B. Describe in your own words what indentation is used for in Python.
C. Describe in your own words what a function is in Python, how it is different from a plain program, and why you would use functions.
D. Given the code below
def ankh( gaspode, gavin)
D.a. If the input to function ankh above is 8 and 3, what is returned by ankh?
E. Write a Python program to
F. What kind of error checking should be done if
G. Give at least four values that should be used as input to test
print "Today is a good day";
while k < 10:
wald = wald + k
print "wald is " wald
m == wald
if m % 2 == 0:
return "even"
else:
return odd
temp = 0
while gaspode > 0
temp = gavin + temp
return temp
BMI = weight in kg divided by the square of height in meters
An average BMI is roughly 21 - 24. Less than this is slender, greater than this is muscled for purposes of this question.