Midterm Exam Topics (Prof. Chang's section) CMSC 201.

Slides:



Advertisements
Similar presentations
Chapter 2 Flow of Control. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 2-2 Learning Objectives Boolean Expressions Building, Evaluating.
Advertisements

ECS 15 if and random. Topic  Testing user input using if statements  Truth and falsehood in Python  Getting random numbers.
Logic & program control part 3: Compound selection structures.
String and Lists Dr. Benito Mendoza. 2 Outline What is a string String operations Traversing strings String slices What is a list Traversing a list List.
Top-Down Design CSC 161: The Art of Programming Prof. Henry Kautz 9/16/2009.
Μαθαίνοντας Python [Κ4] ‘Guess the Number’
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie July 5, 2005.
COMP 14 Introduction to Programming Miguel A. Otaduy May 20, 2004.
CS241 PASCAL I - Control Structures1 PASCAL I - Control Structures Philip Fees CS241.
Testing a program Remove syntax and link errors: Look at compiler comments where errors occurred and check program around these lines Run time errors:
Introduction to Python Lecture 1. CS 484 – Artificial Intelligence2 Big Picture Language Features Python is interpreted Not compiled Object-oriented language.
CIS Computer Programming Logic
STRINGS CMSC 201 – Lab 3. Overview Objectives for today's lab:  Obtain experience using strings in Python, including looping over characters in strings.
 Expression Tree and Objects 1. Elements of Python  Literals, Strings, Tuples, Lists, …  The order of file reading  The order of execution 2.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 4 Decision.
Computer Science 111 Fundamentals of Programming I Making Choices with if Statements.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
Synthesis ENGR 1181 MATLAB 11. Topics  No new material  Covers topics that will be on the Midterm 2 Exam MATLAB 01 – Program Design MATLAB 02 – Introduction.
CSCI 3328 Object Oriented Programming in C# Chapter 5: C# Control Statement – Part II – Exercises 1 Xiang Lian The University of Texas Rio Grande Valley.
Copyright ©2005  Department of Computer & Information Science JavaScript Modularity.
CSCI/CMPE 4341 Topic: Programming in Python Review: Exam I Xiang Lian The University of Texas – Pan American Edinburg, TX 78539
Decision Making CMSC 201. Overview Today we will learn about: Boolean expressions Decision making.
Python Conditionals chapter 5
REVIEW No curveballs this time …. PROBLEM TYPE #1: EVALUATIONS.
CS241 PASCAL I - Control Structures1 PASCAL Control Structures Modified Slides of Philip Fees.
CONDITIONALS. Boolean values Boolean value is either true or false It is name after the British mathemetician, George Boole who first formulated Boolean.
Last Week Modules Save functions to a file, e.g., filename.py The file filename.py is a module We can use the functions in filename.py by importing it.
Midterm Review Important control structures Functions Loops Conditionals Important things to review Binary Boolean operators (and, or, not) Libraries (import.
REVIEW No curveballs this time …. PROBLEM TYPE #1: EVALUATIONS.
1 CS 177 Week 6 Recitation Slides Review for Midterm Exam.
Decision Making CMSC 201 Chang (rev ).
Midterm1 answers: Page 1 1 a6 b6 c0 2 ***. Midterm1 answers: Page 2 A)a. 53b. 44c. 13d. 75e. 77 B)a. 53b. 17c. 33 / 44d. 13e. 75 C)a. ‘5’b. ‘3’c. ‘ ‘d.
The If Statement There are no switch statements in Python. You need to use just if statements. There are no switch statements in Python. You need to use.
Python Basics  Values, Types, Variables, Expressions  Assignments  I/O  Control Structures.
String and Lists Dr. José M. Reyes Álamo. 2 Outline What is a string String operations Traversing strings String slices What is a list Traversing a list.
CS 1428 Final Exam Review. Exam Format 200 Total Points – 60 Points Writing Programs – 45 Points Tracing Algorithms and determining results – 20 Points.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
CMSC201 Computer Science I for Majors Lecture 05 – Comparison Operators and Boolean (Logical) Operators Prof. Katherine Gibson Prof. Jeremy.
Python Basics.
G. Pullaiah College of Engineering and Technology
CMSC201 Computer Science I for Majors Lecture 05 – Comparison Operators and Boolean (Logical) Operators Prof. Katherine Gibson Based on slides by Shawn.
Topic: Iterative Statements – Part 1 -> for loop
Making Choices with if Statements
Topic: Conditional Statements – Part 2
Python: Control Structures
Expressions An expression is a portion of a C++ statement that performs an evaluation of some kind Generally requires that a computation or data manipulation.
Basic operators - strings
Topics The if Statement The if-else Statement Comparing Strings
Learning About the Loop Structure (continued)
CSC115 Introduction to Computer Programming
Topics The if Statement The if-else Statement Comparing Strings
Selection CIS 40 – Introduction to Programming in Python
And now for something completely different . . .
Computers & Programming Languages
The University of Texas – Pan American
The University of Texas – Pan American
Bools & Ifs.
Practice with loops! What is the output of each function below?
CSCI 3328 Object Oriented Programming in C# Chapter 5: C# Control Statement – Part II – Exercises UTPA – Fall 2012 This set of slides is revised from.
CS 1428 Final Exam Review.
String and Lists Dr. José M. Reyes Álamo.
3. Decision Structures Rocky K. C. Chang 19 September 2018
Introduction to Programming Using Python PART 2
Adding Intelligence Check for the presence or absence of a condition in the environment Take the appropriate actions Involves making a choice (to do or.
CS 1428 Final Exam Review.
Data Types and Expressions
Python Basics with Jupyter Notebook
QUIZ 5 – RESULT.
Class code for pythonroom.com cchsp2cs
COMPUTING.
Presentation transcript:

Midterm Exam Topics (Prof. Chang's section) CMSC 201

Midterm Topics Variables assignment expressions types strings lists input function print function Unix commands Boolean expressions if statements nested if statements cascading if statements while loops for loops nested loops

Not on Midterm Base conversion Emacs Intentional syntax errors The answer is never "There's no output because the program has a syntax error" functions Python 2

Tasks on Midterm You may be asked to: produce the output of a program fragment trace the execution of a program write small programs use input( ) and print( ) functions use lists and strings

Variables, assignments, expressions & type Python variables are not typed, but Python values have type. Types you need to know: integer, float, string, list, boolean. Trace through a program fragment and figure out the value stored in a variable. Be familiar with operators: +, –, *, /, **, //, % Operator precedence

Strings and Lists Know the difference between strings and lists. Lists can have items of different type. Use [ ] for indexing and slicing Work with strings and lists using a for loop and/or a while loop. + operator on strings and lists.append( ) method for lists

input() and print() Be able to write programs with input and print Use print with and without newlines Work with return values from input (Python 3).

Unix commands cd change directory lslist files in current directory mkdirmake new directory

Boolean Expressions True and False in Python Relational operators: = > Boolean operators: and or not Short circuit evaluation Can store Boolean values using assignment

if statements if statements with and without an else part nested if statements cascading if statements using elif write program fragments using if statement

while & for trace program fragments and write down output write your own program fragments with while / for work with strings and lists nested while and for loops for loops using range( ) for loops using: for item in aList:

format Some True/False questions (no partial credit) Some multiple choice questions (no partial credit) Some short responses Some long responses (write a program)