Programming with Multimedia Objects CS 177 Lukasz (Luke) Ziarek BASICS Course Mechanics Expectations 1.

Slides:



Advertisements
Similar presentations
CS107 Introduction to Computer Science Lecture 2.
Advertisements

CS107: Introduction to Computer Science Lecture 2 Jan 29th.
Intro to CIT 594
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Python Programming: An Introduction to Computer Science
INTRODUCTION T.Najah Al_Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System CS240.
CS150 Introduction to Computer Science 1 Professor: Chadd Williams.
Chapter 2: Algorithm Discovery and Design
CS107 Introduction to Computer Science Lecture 2.
CS101- Lecture 11 CS101 Fall 2004 Course Introduction Professor Douglas Moody –Monday – 12:00-1:40 – – –Web Site: websupport1.citytech.cuny.edu.
Class 1: What this course is about. Assignments Reading: Chapter 1, pp 1-33 Do in Class 1: –Exercises on pages 13, 14, 22, 28 To hand in in Class 2: –Exercises.
Introduction to Programming with Java, for Beginners Welcome.
COMP 110 Introduction to Programming Jingdan Zhang June 20, 2007 MTWRF 9:45-11:15 am Sitterson Hall 014.
Introduction to a Programming Environment
Chapter 2: Algorithm Discovery and Design
Chapter 3 Planning Your Solution
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
Computer Graphic with Programming Ching-Shoei Chiang, Fall 2013 Most of the teaching material is from Prof. Hoffmann, Purdue University BASICS Course Mechanics.
Introduction to High-Level Language Programming
The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction CSE 1310 – Introduction to Computers and Programming
Computing with Numbers CSC 161: The Art of Programming Prof. Henry Kautz 9/14/2009.
CIS Computer Programming Logic
Welcome to CS 3260 Dennis A. Fairclough. Overview Course Canvas Web Site Course Materials Lab Assignments Homework Grading Exams Withdrawing from Class.
COMP Introduction to Programming Yi Hong May 13, 2015.
Introduction to Python
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Python Programming, 2/e1 Python Programming: An Introduction to Computer Science Chapter 2.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1-1 Welcome to: CSC225 Introduction to Computer Organization.
The Study of Computer Science Chapter 0 Intro to Computer Science CS1510.
CSc 2310 Principles of Programming (Java) Dr. Xiaolin Hu.
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science, C++ Version, Third Edition.
Invitation to Computer Science, Java Version, Second Edition.
Computer Science 10: Introduction to Computer Science Dr. Natalie Linnell with credit to Cay Horstmann and Marty Stepp.
Program Development Life Cycle (PDLC)
1 8/29/05CS150 Introduction to Computer Science 1 Professor: Shereen Khoja
CSCI 51 Introduction to Computer Science Dr. Joshua Stough January 20, 2009.
CS 140 Computer Programming (I) Second semester (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information.
Bilgisayar Mühendisliği Bölümü CENG 102 – Computer Programming Melek OKTAY Syllabus Administrative Information.
Welcome to CS 115! Introduction to Programming. Class URL Write this down!
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Class 1: What this course is about. Assignment Read: Chapter 1 Read: Chapter 1 Do: Chapter 1 ‘workbook’ pages not finished in class Do: Chapter 1 ‘workbook’
CPSC 121: Models of Computation Unit 0 Introduction George Tsiknis Based on slides by Patrice Belleville and Steve Wolfman.
June 19, Liang-Jun Zhang MTWRF 9:45-11:15 am Sitterson Hall 011 Comp 110 Introduction to Programming.
1 CS1100 Fall Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems CS100J:
ICS202 Data Structures King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science Department.
CSE8A: Introduction to Programming in Java Fall 2012 Prof. Christine Alvarado cse8afall.weebly.com.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
Programming and Languages Dept. of Computer and Information Science IUPUI.
CS151 Introduction to Digital Design Noura Alhakbani Prince Sultan University, College for Women.
Programming Languages Programming languages are a compromise between spoken language and formal math. They allow humans to communicate with computers at.
Computer Networks CNT5106C
1 CS100J Spring Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems.
Spring 2008 Mark Fontenot CSE 1341 – Honors Principles of Computer Science I Note Set 1 1.
電腦圖學 Computer Graphic with Programming
Component 1.6.
Computer Engineering Department Islamic University of Gaza
CSCI-235 Micro-Computer Applications
GC101 Introduction to computers and programs
Computer Architecture Syllabus
Computer Science 102 Data Structures CSCI-UA
CS190/295 Programming in Python for Life Sciences: Lecture 1
Welcome to CS 1010! Algorithmic Problem Solving.
Course page: CSE/Math 1560: Introduction to Computing for Mathematics and Statistics Winter 2011 Suprakash Datta.
CMSC201 Computer Science I for Majors Final Exam Information
Computer Engineering Department Islamic University of Gaza
Professor: Shereen Khoja
Presentation transcript:

Programming with Multimedia Objects CS 177 Lukasz (Luke) Ziarek BASICS Course Mechanics Expectations 1

Curriculum Survey You are asked to participate in a survey about the core curriculum for the College of Sciences

Goals for CS177 Teach fundamentals of programming Python Show the scientific and interdisciplinary nature of computer science Demonstrate the breadth of the field of computer science

Class Meets Lecture: Wed, Fri 4:30 ─ 5:20pm Labs: many! Recitation sessions: many! TAs: check course website Web page: 4

Office Hours Luke Ziarek W 12:00pm – 2:00pm F 1:00pm – 4:00pm HAAS 142 Dr. Martino M 12:00pm – 1:00pm T 10:00am -12:00pm TAs Will be posted on class website Additional hours will be scheduled closer to midterms and finals

SCI 210 Teaming Requirement Given online via blackboard module First 6 weeks of the semester 2 Team Projects Team Labs

Text Book John Zelle Python Programming: An Introduction to Computer Science (SECOND EDITION) Franklin, Beedle & Associates Inc. 7 We will use other material from the web including some the book’s website

Python Wiki Book We will also make use of a Wiki Book (online book) Link provided on course website Very concise reference Additional examples and exercises (practice)

Piazza Online Forum Software Link, Registration Information, and Tutorial provided on class website Post Questions on Piazza Faster turn around time Use your classmates as a resource Registration: Use your Purdue Login ID Example: lziarek

Piazza Policies Do not post answers on Piazza This will be considered cheating Make your questions as general as possible Avoid posting large amounts of code Use Tags #lab1 #project1 #prelab1 If you are note sure use the #private tag or Only instructors and TAs can see (we will make it public)

Grading 5 Projects25% Weekly Lab25% 2 midterm exams25% Final exam20% Class Participation5% Class will be graded on a curve Borderline cases are a judgment call 11

Projects Due in class at the beginning of course Hand in will be electronic (similar to labs) Late policy: Up to 24h: –20% Up to 48h: –50% More than 48h late:no credit You may discuss the projects (Piazza), but you must do it separately Two projects will be team projects Cheating cases sent to Dean of Students office 12

Exams No extra materials No cell phones, calculators, PDAs, etc Cheating referred to Dean of Students Office Week 6 and Week 11 exact times TBA 13

Labs and PreLabs Starting with Lab 2 we will offer a PreLab Available on the course wiki NOT graded Will contain a review and practice code to help you study/prepare for Lab PreLabs should take about an hour (or less) You can bring the PreLab to the lab Covers material in previous week Will be made available on Friday of the week prior

Policies Please read and familiarize yourself with: Link provided on course website You must “sign” or accept the CS policies via the computer science portal More details on the course website

Software JES – Robot Labs Python Development Environment IDLE - Python Vanilla Python Note: JES will be introduced in your first robot lab

iClicker Will be used for in class quizzes (attendance)

Class Structure (weekly) 2 Lectures Concepts 1 Recitation Review, Libraries, Interactive Coding, additional background 1 Pre Lab Review / Practice 1 Lab Realizing concepts in code

Class Structure First 6 Weeks Boot Camp for Python Learn the Core Python Language Rest of the class Additional CS concepts Algorithms Data Structures Complexity / Recursion / Others Final Project Bring everything together (Biology Application)

What is computer science? 20

What is computer science? The study of process or computation expressed as algorithms. “Computers are to computer science what telescopes are to astronomy.” – E. Dijkstra 21

Algorithms Algorithms are the main focus Algorithms formally describe computational processes Programs embody algorithms Note: An algorithm is independent of how a program implements it 22

Algorithm Example 1. Remove book from bag 2. Place book on desk 3. Open book to first page 4. Until end of book, Read. Step 4 contains a few complexities. Until suggests that there is some repetition and Read could represent an algorithm also 23

The algorithm describes the process that we want the computer to perform The challenge is telling the computer how to perform that process

Algorithms Algorithms can specify how we access data

Data structures Data structures specify how data is organized What if the phone book was not alphabetical?

So what IS a program? A collection of algorithms and data structures

Up Next Binary Programming Languages Brief Introduction to Python Statements Python Math Library

Homework Read Chapter 1 Read Course Policies Signup for Piazza Register your iclicker

Quick Review What is Computer Science? What is an Algorithm? We know that a program is a collection of implemented algorithms and data structures How do we develop a program?

The Software Development Process The process of creating a program is often broken down into stages according to the information that is produced in each phase.

The Software Development Process Analyze the Problem Figure out exactly the problem to be solved. Try to understand it as much as possible.

The Software Development Process Determine Specifications Describe exactly what your program will do. Don ’ t worry about how the program will work, but what it will do. Includes describing the inputs, outputs, and how they relate to one another. You can think of your assignments as providing a specification

The Software Development Process Create a Design Formulate the overall structure of the program. This is where the how of the program gets worked out. You choose or develop your own algorithm that meets the specifications.

The Software Development Process Implement the Design Translate the design into a computer language. In this course we will use Python.

The Software Development Process Test/Debug the Program Try out your program to see if it worked. If there are any errors (bugs), they need to be located and fixed. This process is called debugging. Your goal is to find errors, so try everything that might “ break ” your program!

The Software Development Process Maintain the Program Continue developing the program in response to the needs of your users. In the real world, most programs are never completely finished – they evolve over time.

Processor

What Computers Understand Modern (digital) computers understand two basic states: On Off This is represented by high and low voltage on a wire.

A single On/Off wire represents 1 bit. 8 bits are combined together to form a byte. Representing On/Off as 1/0 is called Binary. Binary is a base 2 number system Our every-day numbers are base 10

Binary In base 10, each place holder or digit position represents a power of 10. In binary, each place holder represents a power of 2. The number 135 is broken down as 1* * *10 0 in base 10

Binary The base determines how many digits are available. – In base 10 there are ten digits (0 … 9) – In base 2 there are two digits (0 or 1) The binary number 101 is broken down as 1* * *2 0 or 4+1=5 (converted to base 10)

Binary Despite having a different base, arithmetic is the same Add each column and carry digits = 10 as the 1 is carried = 1010

Longer Example

Longer Example

Longer Example

Longer Example

Longer Example

Longer Example

Longer Example Verification: = 56

Arithmetic Hardware All modern computers have various hardware tasks built into them. For addition, each column of the computation corresponds to a single wire and the 0/1 states are toggled by basic logic gates For complex tasks this is much too tedious

Saying “hello” in binary

Hardware Instructions One step up from the hardware itself is a set of hardware instructions These are the basic elements of programming that the hardware is capable of supporting. These are typically still very tedious as each instruction directly corresponds to a hardware element.

section.text global _start, write write: mov al,1 syscall ret _start: mov rax,0x0a68732f6e69622f push rax xor rax,rax mov rsi,rsp mov rdi,1 mov rdx,8 call write exit: xor rax,rax mov rax,60 syscall saying ‘Hello World’ with x86 assembly

Programming Languages Programming languages are a compromise between spoken language and formal math. They allow humans to communicate with computers at a higher level than machine instructions Note: Software can usually be created using different programming languages, such as Java, Python, C++, etc.

Languages Cont. The easier the language is for humans to use, the harder it is for a computer to interpret. Natural language is ambiguous: Fruit flies like bananas There are many languages at many different ‘levels’ of complexity and convenience.

Grammar and Syntax Languages have a set grammar and syntax Defines a “valid” program Punctuation: “,. ! ; : ?” always follows a word in English. Words are the basic building block in English

Building Blocks of Python Numbers, booleans, strings, floating point numbers, and variables are basic building blocks of Python True for most programming languages Keywords Python’s grammar defines how these building blocks fit together

Grammar Check When executing a python program IDLE will tell you when your grammar is incorrect Given as error messages

Numbers in Python Python allows us to work with familiar base 10 numbers. This is an example of the utility of programming languages. Numbers in python have various types. 1.0 vs 1 See Chapter 3 Section 1 for more details! Note: Python needs to be told what type of math you want to do

Booleans Booleans are truth values True or False (both are keywords in Python) Booleans also have a type: bool

Python Grammar Code in python consists of one of several things Statement Function Declaration Function Call Loop Conditional

Statements These are the most basic elements in python code Statements fit on a single line and typically Assign a value to a variable Perform arithmetic Print something Call functions or procedures

Examples print(“Hello”) print(“Hello” + “World”) print(abs(-1)) print(1.0/2.0) print(1/2)

Using Python as a Calculator In the interactive mode you can type statements for python to evaluate >>> >>> 10/2 5 >>> 10%2 0

Using the Math Library Besides (+, -, *, /, //, **, %, abs), we have lots of other math functions available in a math library. A library is a module with some useful definitions/functions.

Using the Math Library Let ’ s write a program to compute the roots of a quadratic equation! The only part of this we don ’ t know how to do is find a square root … but it ’ s in the math library!

Using the Math Library To use a library, we need to make sure this line is in our program: import math Importing a library makes whatever functions are defined within it available to the program.

Using the Math Library To access the sqrt library routine, we need to access it as math.sqrt(x). Using this dot notation tells Python to use the sqrt function found in the math library module. To calculate the root, you can do discRoot = math.sqrt(b*b – 4*a*c)

Homework Read Chapter 2 Up to (less than 20 pages) Go through Pre Lab 2 Start going through the python tutorial Programmer%27s_Tutorial_for_Python_3 Programmer%27s_Tutorial_for_Python_3 Its located toward the bottom of the python wiki book main page