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

Slides:



Advertisements
Similar presentations
Python Programming Chapter 5: Fruitful Functions Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
Advertisements

Memory Management Chapter 7.
Programming in Visual Basic
Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
Debugging Introduction to Computing Science and Programming I.
Pseudocode and Algorithms
Computer Science 1620 Programming & Problem Solving.
Genome Sciences 373 Genome Informatics Quiz Section #1 March 31, 2015.
Chapter 1 Program Design
Testing a program Remove syntax and link errors: Look at compiler comments where errors occurred and check program around these lines Run time errors:
AlgoTutor Tutorial (3) Program Pad J. Yoo, S. Yoo, C. Pettey, S. Seo, and Z. Dong MTSU Computer Science Department Making the transition from the algorithm.
CS1101: Programming Methodology Aaron Tan.
Computer Science 101 Introduction to Programming.
COMP 111 Programming Languages 1 First Day. Course COMP111 Dr. Abdul-Hameed Assawadi Office: Room AS15 – No. 2 Tel: Ext. ??
General Programming Introduction to Computing Science and Programming I.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Computer Science 101 Introduction to Programming.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Programming Lifecycle
School of Computer Science & Information Technology G6DICP - Lecture 9 Software Development Techniques.
CPSC 217 T03 Week I Part #1: Unix and HELLO WORLD Hubert (Sathaporn) Hu.
CS1010E Programming Methodology Tutorial 1 Basic Data Type and Input/output, Characters and Problem Solving C14,A15,D11,C08,C11,A02.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Conditions. Objectives  Understanding what altering the flow of control does on programs and being able to apply thee to design code  Look at why indentation.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Constants Numeric Constants Integer Constants Floating Point Constants Character Constants Expressions Arithmetic Operators Assignment Operators Relational.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
Python Programming Using Variables and input. Objectives We’re learning to use basic knowledge of variables combined with user input. Outcomes Continue.
CPSC 217 T03 Week I Part #2: Python Tricks for Exercise #1 Hubert (Sathaporn) Hu.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 3, Lecture 1.
Lecture 2 Examples Pseudo code and flowcharts. Problem 1 Read a number as input and then print if it is even or odd.
1. Understand the application of Pseudo Code for programming purposes 2. Be able to write algorithms in Pseudo Code.
Python Conditionals chapter 5
CPSC 217 T03 Week III Part #1: Base Conversion Hubert (Sathaporn) Hu.
REVIEW No curveballs this time …. PROBLEM TYPE #1: EVALUATIONS.
CPSC 217 T03 Week II Part #1: SimpleGraphics.py Hubert (Sathaporn) Hu.
CPSC 217 T03 Week VI Part #1: A2 Post-Mortem and Functions Hubert (Sathaporn) Hu.
CPSC 217 T03 Week V Part #1: Iteration Hubert (Sathaporn) Hu.
The Hashemite University Computer Engineering Department
REVIEW No curveballs this time …. PROBLEM TYPE #1: EVALUATIONS.
Midterm Exam Topics (Prof. Chang's section) CMSC 201.
AF2. Turn off your phones Primes, gcd, some examples, reading.
CS 127 Exceptions and Decision Structures. Exception Handling This concept was created to allow a programmer to write code that catches and deals with.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 3 Decision Trees Conditionals.
If statement.  It is made up of three main components:  The keyword itself,  an expression that is tested for its truth value,  and a code suite to.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
Algorithms and Pseudocode
Computer Science 1000 Algorithms III. Multiple Inputs suppose I ask you to write a program that computes the area of a rectangle area = length * width.
CPSC 217 T03 Week IX Part #1: Function, Iteration and List Hubert (Sathaporn) Hu.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #003 (February 14, 2015)
COMPUTER PROGRAMMING Year 9 – lesson 1. Objective and Outcome Teaching Objective We are going to look at how to construct a computer program. We will.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
Programming revision Revision tip: Focus on the things you find difficult first.
GCSE Computer Science Information.
Introduction to Algorithms
GCSE COMPUTER SCIENCE Practical Programming using Python
CS1010 Programming Methodology
Introduction to Computing Science and Programming I
CMPT 120 Topic: Python’s building blocks -> More Statements
Data Types Variables are used in programs to store items of data e.g a name, a high score, an exam mark. The data stored in a variable is entered from.
Computer Science 101 While Statement.
Learning to Program in Python
Learning to Program in Python
PROBLEM SOLVING CSC 111.
Topic 1: Problem Solving
Algorithm and Ambiguity
Introduction to Algorithms
Presentation transcript:

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

Today’s Tutorial Midterm review

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.

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.

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

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

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  Triangle  Found 2 triangle(s)

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)

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

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

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

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

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!”)

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!