CompSci 101 Introduction to Computer Science September 23, 2014 Prof. Rodger.

Slides:



Advertisements
Similar presentations
Loops –Do while Do While Reading for this Lecture, L&L, 5.7.
Advertisements

CompSci 101 Introduction to Computer Science February 3, 2015 Prof. Rodger Lecture given by Elizabeth Dowd.
CompSci 101 Introduction to Computer Science Feb 26, 2015 Prof. Rodger.
CompSci 18S Recursion Dec 4, 2006 Prof. Susan Rodger.
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring
COMP 1001: Introduction to Computers for Arts and Social Sciences Programming in Scratch Monday, May 16, 2011.
CompSci 101 Introduction to Computer Science January 20, 2015 Prof. Rodger compsci 101, spring
60 Questions (review for final exam) CSC 161: The Art of Programming Prof. Henry Kautz 12/7/
COMPSCI 101 Principles of Programming Lecture 25 – Nested loops, passing mutable objects as parameters.
CompSci 6 Introduction to Computer Science October 20, 2011 Prof. Rodger.
CompSci 4 Chap 8 Sec 1 Nov 17, 2005 Prof. Susan Rodger Note: thanks to Wanda Dann and Steve Cooper for slide ideas.
CompSci 101 Introduction to Computer Science Sept. 9, 2014 Prof. Rodger President Brodhead speech graduation 2010 CompSci 101 Fall
CompSci 6 Introduction to Computer Science November 1, 2011 Prof. Rodger.
CompSci 6 Introduction to Computer Science Sept 29, 2011 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were not.
`. Lecture Overview Structure Programming Basic Control of Structure Programming Selection Logical Operations Iteration Flowchart.
CompSci 6 Introduction to Computer Science November 8, 2011 Prof. Rodger.
CompSci 101 Introduction to Computer Science November 18, 2014 Prof. Rodger.
Loops.  (No Quiz)  Hand in Assignment #1  Last chance for Q+A on the midterm  Loops 2.
CompSci 6 Introduction to Computer Science September 13, 2011 Prof. Rodger.
CompSci 101 Introduction to Computer Science March 31, 2015 Prof. Rodger Thanks to Elizabeth Dowd for giving this lecture Review for exam.
CompSci 101 Introduction to Computer Science February 10, 2015 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were.
CompSci 101 Introduction to Computer Science January 28, 2016 Prof. Rodger compsci101 spring161.
COMP Loop Statements Yi Hong May 21, 2015.
Compsci 06/101, Spring Compsci 6: PFTW l Problem solving and (Python) programming  What are the steps in solving an APT?  How do you get better.
CompSci 101 Introduction to Computer Science February 4, 2016 Prof. Rodger compsci101 spring161.
CompSci 101 Introduction to Computer Science Feb 24, 2015 Prof. Rodger.
CompSci 6 Introduction to Computer Science Sept. 20, 2011 Prof. Rodger CompSci 6 Fall
CompSci 101 Introduction to Computer Science February 11, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science January 26, 2016 Prof. Rodger compsci 101, spring
CompSci 101 Introduction to Computer Science November 11, 2014 Prof. Rodger CompSci 101 Fall Review for exam.
CompSci 101 Introduction to Computer Science January 15, 2015 Prof. Rodger 1.
CompSci 6 Introduction to Computer Science September 27, 2011 Prof. Rodger CompSci 6 Fall
CompSci 101 Introduction to Computer Science February 16, 2016 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were.
CompSci 101 Introduction to Computer Science April 7, 2015 Prof. Rodger.
CompSci 101 Introduction to Computer Science March 24, 2016 Prof. Rodger compsci 101, spring
CompSci 101 Introduction to Computer Science March 8, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science April 14, 2016 Prof. Rodger Lecture today by Sriram Vepuri.
CompSci 101 Introduction to Computer Science March 1, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science April 14, 2016 Prof. Rodger compsci101 spring161.
CompSci 101 Introduction to Computer Science March 29, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science February 5, 2015 Prof. Rodger Lecture given by Elizabeth Dowd compsci101 spring151.
CompSci 101 Introduction to Computer Science Sept 13, 2016 Prof. Rodger compsci101 fall161.
CompSci 4 Java 1 Apr 2, 2009 Prof. Susan Rodger. Announcements Assignment 7 questions? –Beware having two events that kick in at the same time! –Beware.
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 6 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Introduction to Programming
Introduction to Programming
CompSci 101 Introduction to Computer Science
Presentation transcript:

CompSci 101 Introduction to Computer Science September 23, 2014 Prof. Rodger

Announcements No Reading for next time on calendar page –No Reading Quiz til after the exam –Must finish all RQ by Thursday!! Assignment 4 due Thursday APT 3 is due today Exam 1 is in one week – Sept 30 –Do the Practice Test by class Thursday –Fill out form on course web page if you have accommodations and/or cannot take the exam –One week for Regrade request Finish lecture notes from last time

Assignment 4 steps Run the program Create the simple text file Modify transform method –Apply transformation to every word in list of lists Modify write_words – write to file Modify transformations (pig-latin, rot13, etc)

Passing Functions as Parameters def upperWord(word): return word.upper() def argWord(word): return word + “arg” def transformWord(func, word): return func(word) print transformWord(upperWord, “train”) print transformWord(argWord, “truck”) CompSci 6 Fall 20114

While loops Repetition when you stop a loop based on a condition while CONDITION: BODY –As long as condition is true, keep executing loop. –Must have an update in the body to get closer to condition being false Example: Repeat in chess until someone wins. When will that be? 5

Mystery While example

While loops Problem 1: Does a letter, say ‘o’, appear at least three times in a string? What if the string is very long? Can we stop early if we counted three ‘o’s? Problem 2: Can we return the words in the phrase up until the third “o”? 7

Example 8

Tiffany Chen B.S. Duke (UTA, ACM president) Ph.D Stanford, 2012, in Biomedical Informatics Stem Cell biology Cancer drug screening Director of Informatics at Cytobank

Problem Solving Assume vowels are: aeiou Write vowelsOnly(word) –Returns word with only the vowels Write allVowels(word) –- return true if word is all vowels