Compsci 06/101, Fall 2010 2.1 What will we do today? l Practice solving problems  Solving problems without a computer  Is this different than solving.

Slides:



Advertisements
Similar presentations
CS 100: Roadmap to Computing Fall 2014 Lecture 0.
Advertisements

16-Jun-15 Recursion. 2 Definitions I A recursive definition is a definition in which the thing being defined occurs as part of its own definition Example:
16/27/ :53 PM6/27/ :53 PM6/27/ :53 PMLogic Control Structures Arithmetic Expressions Used to do arithmetic. Operations consist of +,
28-Jun-15 Recursion. 2 Definitions I A recursive definition is a definition in which the thing being defined occurs as part of its own definition Example:
CS 1 with Robots Variables, Data Types & Math Institute for Personal Robots in Education (IPRE)‏
Yeshivah of Flatbush After-School Math Enrichment 2009 Jerry B. Altzman, Ph.D.
Laboratory Study October, The very first example, traditional "Hello World!" program: public class first { public static void main (String[ ]
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
CompSci 100 Prog Design and Analysis II Sept 7, 2010 Prof. Rodger 1CompSci 100 Fall 2010.
Goals of Course Introduction to the programming language C Learn how to program Learn ‘good’ programming practices.
Compsci 101, Fall Plan for the week: Week 2, Sept 1-5 l Understanding program structure  Defining, testing, calling functions  How to run a.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
Compsci 06/101, Fall Compsci 6/101: Sept 6-10 l We've looked at the language Python  Names and types: int, float, long, String, file, …  Operations:
Compsci 101.2, Fall PFTT (plan for this Thursday) l What is a Python program?  In the context of what we do in Compsci 101  In a neuroscience.
Compsci 101.2, Fall Plan For the Week l Solve problems by programming in Python  Like to do "real-world" problems, but we're very new to the.
General Computer Science for Engineers CISC 106 Lecture 04 Dr. John Cavazos Computer and Information Sciences 09/10/2010.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Compsci 100, Fall Data and Information How and why do we organize data? Differences between data and information? What about knowledge?
Functions, Procedures, and Abstraction Dr. José M. Reyes Álamo.
Making Decisions uCode: October Review What are the differences between: o BlueJ o Java Computer objects represent some thing or idea in the real.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
CompSci 101 Introduction to Computer Science Sept. 9, 2014 Prof. Rodger President Brodhead speech graduation 2010 CompSci 101 Fall
Copyright 2008 by Pearson Education 1 Building Java Programs Chapter 2 Lecture 2-1: Expressions and Variables reading:
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 6: Object-Oriented Programming.
Compsci 6/101, Spring More on Python, Tools, Compsci 101 l APTs, Assignments, Tools  APT: Algorithmic Problem-solving and Testing  How to get.
Compsci 101.2, Fall PFTWeek l Introduce new Python concepts  Control: if, elif, else, for  Data: Strings, Lists Operators on data: slicing,
CS 1 with Robots Variables, Data Types & Math Institute for Personal Robots in Education (IPRE)‏ Sec 9-7 Web Design.
Compsci 06/101, Fall Vocabulary l What's the Spanish word for 'boy'? 'eat'?  How do you know? l What about the Turkish equivalents?  How do.
1 Programming for Engineers in Python Autumn Lecture 6: More Object Oriented Programming.
CPS 100, Spring Data and Information How and why do we organize data? Differences between data and information? What about knowledge?
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, Fall Plan For The Day (PFTD) l Practice solving problems  Some solved with a computer, some with Python  Differences in solving.
More Sequences. Review: String Sequences  Strings are sequences of characters so we can: Use an index to refer to an individual character: Use slices.
Compsci 101.2, Fall Plan for October 22 l Images, tuples, RGB color model  Image processing by understanding API  Image processing with tuples.
CPS APTs and structuring data/information l Is an element in an array, Where is an element in an array?  DIY: use a loop  Use Collections, several.
CompSci 101 Introduction to Computer Science January 28, 2016 Prof. Rodger compsci101 spring161.
Data Manipulation Variables, Data Types & Math. Aug Variables A variable is a name (identifier) that points to a value. They are useful to store.
Compsci 101.2, Fall Plan for WEFWOO l Review for exam, studying and practicing for exams and APTs in Compsci 101  Why memorization doesn't help.
Compsci 6/101, Spring PFTW: Functions, Control, Python/Tools l How do functions work and why do we use them?  Functions we call (APIs), Functions.
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.
Recursion. Definitions I A recursive definition is a definition in which the thing being defined occurs as part of its own definition Example: A list.
CompSci 101 Introduction to Computer Science January 26, 2016 Prof. Rodger compsci 101, spring
CPS What's in Compsci 100? l Understanding tradeoffs: reasoning, analyzing, describing…  Algorithms  Data Structures  Programming  Design l.
CompSci 101 Introduction to Computer Science January 15, 2015 Prof. Rodger 1.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #003 (February 14, 2015)
IST 210: PHP Basics IST 210: Organization of Data IST2101.
CS 31 Discussion, Week 2 Faisal Alquaddoomi, Office Hours: BH 2432, MW 4:30-6:30pm, F 12:30-1:30pm (today)
Quiz 1 A sample quiz 1 is linked to the grading page on the course web site. Everything up to and including this Friday’s lecture except that conditionals.
Comp1202: Conclusions Revision Session. Coming up Key Concepts - The Pillars HashMaps Exceptions The Exam Some Last Words.
CompSci 101 Introduction to Computer Science
Data and Information How and why do we organize data? Differences between data and information? What about knowledge?
CompSci 101 Introduction to Computer Science
ECS10 10/10
CS 1428 Exam I Review.
Presented By S.Yamuna AP/IT
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Functions, Procedures, and Abstraction
CompSci 101 Introduction to Computer Science
Teaching London Computing
Variables, Data Types & Math
Compsci 6/101: PFTW Review how APTs and Python work, run
Variables, Data Types & Math
CHAPTER 3: String And Numeric Data In Python
Variables, Data Types & Math
Thinking about programming
CS 1428 Exam I Review.
More Basics of Python Common types of data we will work with
Functions, Procedures, and Abstraction
Presentation transcript:

Compsci 06/101, Fall What will we do today? l Practice solving problems  Solving problems without a computer  Is this different than solving problems with a computer? l Learning about vocabulary and sentences  English, Spanish, Swedish, Pythonic! l Practice using tools for Duke Compsci courses  Eclipse, APT, ambient  Blackboard/Sakai, Bulletin board, Feedback l Reveling in the wonder of thinking and working  How do we know when something works?

Compsci 06/101, Fall Vocabulary l What's the Spanish word for boy ? eat ? fish ?  How do you know? l What about the Swedish equivalents?  How do you know? l How do you learn vocabulary of Python?  Words  Sentences  Paragraphs  Essays

Compsci 06/101, Fall What else will we do today? l Naming  The power of abstraction and parameterization  What is abstraction?  What are parameters? What has them? l Types  What have we seen? What's used in computing?  Determine names of types in Python l Expressions and operators in Python  Arithmetic: +, -, *, /, %, **, …  Boolean:, and,...  String: +, *, [], [:], [::]

Compsci 06/101, Fall Counting words in a file redux name = "/data/poe.txt" file = open(name) str = file.read() words = str.split() print "# words in",name, "=",len(words) l What are the names in the code above?  Why are names important? l What are the types in the code above?  How do we get Python to help us answer this question l How do we re-use this code more generally  The power of names!

Compsci 06/101, Fall Names and Types summarized l There are rules for what a valid name is in Python  In addition there are conventions we will use for names l In code shown we see variables, constants, functions, and methods  This is more vocabulary, talking Python to others? l Types for variables and expressions  We see file, string, list, int  There are others we'll use in the course, e.g., double, set, … l Always ask yourself: what's name, what's type

Compsci 06/101, Fall Interlude l Use word-counting code in Eclipse  Python console, type and see  Using names, what is a.py file, user-defined functions  Modules and functions: re-use with minimal re-typing Function is abstraction, parameterization over code Module is abstraction over functions l Python functions and expressions, practicing solving problems  Pounds2Stone  BMI BMI  Heron's formula Heron's formula  …

Compsci 06/101, Fall David Parnas "For much of my life, I have been a software voyeur, peeking furtively at other people's dirty code. Occasionally, I find a real jewel, a well-structured program written in a consistent style, free of kludges, developed so that each component is simple and organized, and designed so that the product is easy to change. "

Compsci 06/101, Fall Parnas on re-invention xkcd 353xkcd 353 "We must not forget that the wheel is reinvented so often because it is a very good idea; I've learned to worry more about the soundness of ideas that were invented only once. "

Compsci 06/101, Fall David Parnas (entry in Wikipedia)Wikipedia l Module Design: Parnas wrote about the criteria for designing modules, in other words, the criteria for grouping functions together. This was a key predecessor to designing objects, and today's object-oriented design. l Social Responsibility: Parnas also took a key stand against the Strategic Defense Initiative (SDI) in the mid 1980s, arguing that it would be impossible to write an application that was free enough from errors to be safely deployed.Strategic Defense Initiative l Professionalism: He believes that software engineering is a branch of traditional engineering.

Compsci 06/101, Fall String operator interlude l Concatenation, what can be added to a string?  How do we find this out using Python?  How are types related to this question? l Slicing and Indexing  How do we get parts of a String?  What are the parts of a String?  [] and [:], l What does immutable mean? Hello to Jello?  What is a variable in Python?

Compsci 06/101, Fall Expressions, Operators, Names Why is 3+5*4 different than (3+5)*4 ?  Where can you find information about precedence? Why is 5/3 different than 5.0/3 ?  What will happen in Python 3? Accommodate in 2.6? l What happens when operators go bad?  What is "apple" + 3? What is "apple" + "pi"? l What is a variable in Python?  Does it have a name? Does it have a type?

Compsci 06/101, Fall Alma Whitten l Google: Engineering Lead for Privacy, Director for Privacy  Across marketing and engineering  Why Johnny Can't Encrypt "It's more and more the case that every individual is going around with a cheap yet powerful data- capture device, and the ability to connect that device to powerful data services. There's a whole interesting minefield to be picked through," (cnet news, October 2010)