Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPSC 217 T03 Week VI Part #2: Midterm Review Session Hubert (Sathaporn) Hu.

Similar presentations


Presentation on theme: "CPSC 217 T03 Week VI Part #2: Midterm Review Session Hubert (Sathaporn) Hu."— Presentation transcript:

1 CPSC 217 T03 Week VI Part #2: Midterm Review Session Hubert (Sathaporn) Hu

2 Today’s Tutorial Midterm review

3 Midterm Review Resource, Again There are multiple resources that you can get before the midterm begins:  CT Hours  Wednesday afternoon tutorials act more like office hours. You can simply just get help there.  And of course, the midterm review session in this tutorial.

4 Midterm structure Similar to the previous years. SimpleGraphics.py won’t be featured in the exam.  It may show up, but only for a couple of marks in the multiple choice. However, my suggestion is that you don’t need to review it. Also, function won’t be on it either. Doing previous exams are helpful. The newer exams should be more helpful though.

5 Midterm Review Activity You are going to work in groups, trying to solve selected midterm problems. I will be going over answer afterwards.

6 Programming Question #1 Full question is available on Fall 2014 midterm. Create a program that find the greatest common divisor (gcd) of 2 integers. The algorithm is already written out. You simply need to translate this into Python:  Set x to the largest absolute value of a and b  While gcd is not found If x divides evenly into a and b –Indicate that gcd is found Otherwise –Reduce x by 1

7 Programming Question #2 Full question is available on Fall 2012 midterm. Let a, b, c be the lengths for a right angle triangles. Create a program that accepts a number n and output all right angle triangles whose a and b is bound between 1 and n. Note that a, b, c must also be integers. Also outputs the number of found triangles. Example output:  Enter an integer: 4  Triangle 3 4 5  Triangle 4 3 5  Found 2 triangle(s)

8 Multiple Choice/Short Answer Question #1 This question is of my own invention! Complete the truth table for:  (a or not b) and (not a or b)

9 Multiple Choice/Short Answer Question #2 This question is also of my own invention! Which of the variable names is stylistically correct?  dogage  dog_age  da  doggyAgey

10 Multiple Choice/Short Answer Question #3 I invented this question as well. Convert 10111111, a base 2 number, into a base 16 number.

11 Multiple Choice/Short Answer Question #4 This question is modified from one in Fall 2012 Midterm. Which type of Python error will always be caught by your compiler before compilation regardless of your input?  Semantic errors  Logic errors  Runtime errors  Syntax errors  More than one of the above answers is correct

12 Multiple Choice/Short Answer Question #5 This question is from Fall 2012 Exam: Which area of computer science concentrates on techniques for determining how efficiently problems can be solved in terms of time and space?  Computer Vision  Distributed Systems  Human Computer Interaction  Information Security  Theory of Computation

13 Multiple Choice/Short Answer Question #6 What happen if the user inputs 1? What about 2? What about 5? What about 6? x = input(“Give me 5! “) if x < 5: print(“You’re not awesome!”) i = 0 while i < x: Print(“  ”) i += 1 elif x == 5: print(“AWESOME!”) else: print(“I said 5!”)

14 Multiple Choice/Short Answer Question #6 Note that question #6 is about code tracing. You need to be able to trace code well. The code tracing on the exam is much harder than the one shown here!


Download ppt "CPSC 217 T03 Week VI Part #2: Midterm Review Session Hubert (Sathaporn) Hu."

Similar presentations


Ads by Google