CompSci 101 Introduction to Computer Science March 31, 2015 Prof. Rodger Thanks to Elizabeth Dowd for giving this lecture Review for exam.

Slides:



Advertisements
Similar presentations
CompSci 101 Introduction to Computer Science February 3, 2015 Prof. Rodger Lecture given by Elizabeth Dowd.
Advertisements

CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
ITC242 – Introduction to Data Communications ITC431 – Computer Networks Week 13 Exam Preparation.
1 Session-13 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-5 due date extended to March 7 Test-1 is on March 9 th ; Demo-5 due date extended to.
Quiz 2 Results: Grade Scale
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
The preprocessor and the compilation process COP3275 – PROGRAMMING USING C DIEGO J. RIVERA-GUTIERREZ.
CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring
CompSci 101 Introduction to Computer Science January 20, 2015 Prof. Rodger compsci 101, spring
8 th Grade Science Overview and Class Procedures Bell Work Aug 12, 2015 Are you READY TO LEARN? Do you have paper, pencil, textbook, and agenda? Bellwork:
An Overview of Programming in Python CSC 161: The Art of Programming Prof. Henry Kautz 9/9/2009 Slides stolen shamelessly from Dr. Mark Goadrich, Centenary.
Welcome to CS 221! First Course in Computer Science for Engineers.
By the end of this session you should be able to...
CS 140 Computer Programming (I) Second semester (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information.
Agenda Review C++ Library Functions Review User Input Making your own functions Exam #1 Next Week Reading: Chapter 3.
CompSci 101 Introduction to Computer Science September 23, 2014 Prof. Rodger.
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.
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.
CompSci 6 Introduction to Computer Science November 8, 2011 Prof. Rodger.
CompSci 101 Introduction to Computer Science November 18, 2014 Prof. Rodger.
CompSci 6 Introduction to Computer Science September 13, 2011 Prof. Rodger.
Compsci 101.2, Fall Plan for FWON l Review current assignments and APTs  Review Dictionaries and how to use them  Code and APT walk-through.
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.
Math 010 online work that was due today at the start of class: Section 1.3A Online Homework.
CompSci 101 Introduction to Computer Science January 28, 2016 Prof. Rodger compsci101 spring161.
CompSci 4 Chap 9 Sec 1 October 28, 2010 Prof. Susan Rodger.
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
HANGMAN- Software/ Hardware Integration Project Idea was to design a working C++ program to play a Hangman word guessing game Idea was to design a working.
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 March 17, 2015 Prof. Rodger compsci 101, spring
CompSci 4 Chap 10 Nov 22, 2005 Prof. Susan Rodger Note: thanks to Wanda Dann and Steve Cooper for slide ideas.
CompSci 101 Introduction to Computer Science February 25, 2016 Prof. Rodger compsci101 spring20161.
CompSci 101 Introduction to Computer Science January 15, 2015 Prof. Rodger 1.
REMINDER: If you haven’t yet passed the Gateway Quiz, make sure you take it this week! (You can find more practice quizzes online in the Gateway Info menu.
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 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 March 29, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science February 5, 2015 Prof. Rodger Lecture given by Elizabeth Dowd compsci101 spring151.
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 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
Welcome to CS 1010! Algorithmic Problem Solving.
CompSci 101 Introduction to Computer Science
Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Quick Review.
Lab 1 Introduction to C++.
CompSci 101 Introduction to Computer Science
CMSC201 Computer Science I for Majors Final Exam Information
The structure of programming
February , 2009 CSE 113 B.
Prof. Qi Tian Fall 2013 CS 3843 Midterm Review Prof. Qi Tian Fall 2013.
Presentation transcript:

CompSci 101 Introduction to Computer Science March 31, 2015 Prof. Rodger Thanks to Elizabeth Dowd for giving this lecture Review for exam

Announcements Exam 2 is Thursday Assignment 7 is out APT 8 is due today Review Session with Prof. Rodger –Wed. 5:30pm, LSRC B101 Finish lecture notes from last time

Snarky Hangman Version of Hangman that is hard to win. Program keeps changing secret word to make it hard to guess! User never knows! Once a letter is chosen and shown in a location, program picks from words that only have that letter in that location Program smart to pick from largest group of words available

Snarky Hangman - Dictionary Builds a dictionary of categories Start with list of words of correct size Repeat –User picks a letter –Make dictionary of categories based on letter –New list of words is largest category Matched letters Letters guessed by not chosen List shrinks in size each time

Snarky Hangman Example Possible scenerio after several rounds You currently have a list of all words with u the second letter. From that build a dictionary of list of words with no c and with c in different places (show count of number of words in each list): Choose “no c”, most words, 21 Only 2 words of this type Only 8 words of this type

Exam logistics Only need a pen or pencil No scratch paper See the reference sheet of Python information you will get with the test (see resources page) Closed book, closed notes, closed neighbor Covers lecture, lab and assigned reading Have put old quizzes back up as quiz review –This is NOT for a grade, for studying only CompSci 101 Spring 20156

Understand old and new topics Old topics: if, for, while, lists, strings list comprehension, enumerate Files – write code - Will give you a file already opened and ready for reading Sets, Dictionaries – write code – create and use Understand items on Python review sheet on resources page HAVE NOT COVERED TOPICS – regular expressions or recursion CompSci 101 Spring 20157

The best way to study Write code on paper! Resources page has old tests and solutions –Try writing code, then look at solutions Rewrite an APT Rewrite code we did in lecture Rewrite code we did in classwork or lab CompSci 101 Spring 20158

Think about how parameters work Look at variables before passed to a method What happens to them after they are passed? Can the parameter and argument have the same name?

number is 5, school is duke In testone, num is 4, s is Hello After call to testone, number is 5, school is duke OUTPUT

Parameter and Argument have the same name

OUTPUT num is 2, s is cat In testone, num is 4, s is Hello After call to testone, num is 2, s is cat

OUTPUT nums is [4, 3, 8, 5] In testtwo, lista is [4, 3, 8, 5, 6] After call to testtwo, nums is [4, 3, 8, 5, 6]

Parameter and Argument have the same name

OUTPUT lista is [4, 3, 8, 5] In testtwo, lista is [4, 3, 8, 5, 6] After call to testtwo, lista is [4, 3, 8, 5, 6]

OUTPUT lista is (4, 5, 2) In testthree, lista is (4, 5, 2) In testthree, lista is (7, 1, 3) after call to testthree, lista is (4, 5, 2)

Parameter and Argument have the same name

OUTPUT lista is [(4, 5, 2), (3, 2), (3, 4)] In testfour, lista is [(4, 5, 2), (3, 2), (3, 4)] In testfour, lista is [(4, 5, 2), (4, 3), (3, 4)] after call to testfour, lista is [(4, 5, 2), (4, 3), (3, 4)]

OUTPUT mylist is [(4, 5, 2), (3, 2), (3, 4)] In testfour, lista is [(4, 5, 2), (3, 2), (3, 4)] In testfour, lista is [(4, 5, 2), (4, 3), (3, 4)] after call to testfour, mylist is [(4, 5, 2), (4, 3), (3, 4)]

OUTPUT myset is set([2, 4, 5]) In testfive, seta is set([2, 4, 5]) In testfive, seta is set([2, 3, 4, 5]) after call to testfive, myset is set([2, 3, 4, 5])

OUTPUT myset is set([(3, 2), (5, 2, 1), (4, 3)]) In testsix, seta is set([(3, 2), (5, 2, 1), (4, 3)]) In testsix, seta is set([(5, 8), (3, 2), (5, 2, 1), (4, 3)]) after call to testsix, myset is set([(5, 8), (3, 2), (5, 2, 1), (4, 3)])

Now go over Test Practice problems