CSC 015: FUNDAMENTALS OF COMPUTER SCIENCE I

Similar documents
Introduction to Computer Programming for Non-Majors CSC 2301, Fall The Department of Computer Science

CS 190C: Introduction to Computational Thinking

Introduction to Computer Programming for Non-Majors

Computers and programming languages introduction

The >>> is a Python prompt indicating that Python is ready for us to give it a command. These commands are called statements.

CS240: Programming in C

Administration Computers Software Algorithms Programming Languages

Introduction, Programming, Python. Michael Mandel Lecture 1 Methods in Computational Linguistics I The City University of New York, Graduate Center

COMP 401 COURSE OVERVIEW

CS 3030 Scripting Languages Syllabus

CSC116: Introduction to Computing - Java

BOSTON UNIVERSITY Metropolitan College MET CS342 Data Structures with Java Dr. V.Shtern (Fall 2011) Course Syllabus

CSC209. Software Tools and Systems Programming.

CSC116: Introduction to Computing - Java

CSC 111 Introduction to Computer Science (Section C)

Anupam Gupta, Braydon Hall, Eugene Oh, Savanna Yee. Steve Jobs custom Apple I and other historic machines are on display at Seattle museum

Introduction to Data Structures

CS 240 Fall Mike Lam, Professor. Just-for-fun survey:

CS1110 Lab 1 (Jan 27-28, 2015)

Introduction to Computer Systems

Welcome to CompSci 201

Computing and compilers

CMPSCI 201: Architecture and Assembly Language

Scientific Computing: Lecture 1

CS 326: Operating Systems. Lecture 1

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013

CS120 Computer Science I. Instructor: Jia Song

CS 1110, LAB 1: PYTHON EXPRESSIONS.

CS 1110 SPRING 2016: GETTING STARTED (Jan 27-28) First Name: Last Name: NetID:

Welcome to Computer Organization and Design Logic

CSC116: Introduction to Computing - Java

An Introduction to Python (TEJ3M & TEJ4M)

Welcome to Solving Problems with Computers I

Today. An Animated Introduction to Programming. Prerequisites. Computer programming

CSC108: Introduction to Computer Programming. Lecture 1

CMSC 201 Spring 2017 Lab 01 Hello World

CS 536. Class Meets. Introduction to Programming Languages and Compilers. Instructor. Key Dates. Teaching Assistant. Charles N. Fischer.

CSC209. Software Tools and Systems Programming.

Outline. CIS 110: Introduction to Computer Programming. What is Computer Science? What is computer programming? What is computer science?

CS 152 Computer Architecture and Engineering Lecture 1 Single Cycle Design

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007

Professor Hugh C. Lauer CS-1004 Introduction to Programming for Non-Majors

ITNW 1425 Fundamentals of Networking Technologies Course Syllabus fall 2012

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Welcome to Computer Organization and Design Logic CS 64: Computer Organization and Design Logic Lecture #1 Winter 2018

CS 241 Computer Programming. Introduction. Teacher Assistant. Hadeel Al-Ateeq

Inf2C - Computer Systems Lecture 1 Course overview & the big picture

CPSC 213. Introduction to Computer Systems. Introduction. Unit 0

CS/SE 153 Concepts of Compiler Design

CSC 172 Data Structures and Algorithms. Fall 2017 TuTh 3:25 pm 4:40 pm Aug 30- Dec 22 Hoyt Auditorium

C H A P T E R 1. Introduction to Computers and Programming

Lecture 1. Introduction to course, Welcome to Engineering, What is Programming and Why is this the first thing being covered in Engineering?

COMP Data Structures

Internet Web Technologies ITP 104 (2 Units)

Chris Simpkins (Georgia Tech) CS 2316 Data Manipulation for Engineers Python Overview 1 / 9

Introduction to Computing Systems: From Bits and Gates to C and Beyond 2 nd Edition

COMP Data Structures

CS 323 Lecture 1. Design and Analysis of Algorithms. Hoeteck Wee

CS313T ADVANCED PROGRAMMING LANGUAGE

CMSC 201 Spring 2018 Lab 01 Hello World

One of the hardest things you have to do is to keep track of three kinds of commands when writing and running computer programs. Those commands are:

CSC 261/461 Database Systems. Fall 2017 MW 12:30 pm 1:45 pm CSB 601

EECS 282 Information Systems Design and Programming. Atul Prakash Professor, Computer Science and Engineering University of Michigan

Fundamentals of Programming. Lecture 1: Introduction to C Programming

EECS 282 Information Systems Design and Programming. Atul Prakash Professor, Computer Science and Engineering University of Michigan

Algorithms and Programming I. Lecture#12 Spring 2015

Exploring Python Basics

CS 240 Fall 2015 Section 004. Alvin Chao, Professor

CS61C Machine Structures. Lecture 1 Introduction. 8/27/2006 John Wawrzynek (Warzneck)

Computer Systems and Networks. ECPE 170 University of the Pacific

CS 241 Data Organization. August 21, 2018

STEAM Clown & Productions Copyright 2017 STEAM Clown. Page 1

CSc 2310 Principles of Programming (Java) Jyoti Islam

INF 315E Introduction to Databases School of Information Fall 2015

MEIN 50010: Python Introduction

COMP 250. Lecture 36 MISC. - beyond COMP final exam comments

CS 3813/718 Fall Python Programming. Professor Liang Huang.

CSE 142. Lecture 1 Course Introduction; Basic Java. Portions Copyright 2008 by Pearson Education

EECE 321: Computer Organization

CS 3030 Scripting Languages Syllabus

CSC 101: Lab Manual#9 Machine Language and the CPU (largely based on the work of Prof. William Turkett) Lab due date: 5:00pm, day after lab session

B. Subject-specific skills B1. Problem solving skills: Supply the student with the ability to solve different problems related to the topics

Programming for Engineers in Python

Introduction to: Computers & Programming: Review prior to 1 st Midterm

Fundamentals of Programming (Python) Basic Concepts. Ali Taheri Sharif University of Technology Spring 2018

COMP Summer 2015 (A01) Jim (James) Young jimyoung.ca

OO software systems are systems of interacting objects.


Python Input, output and variables. Lecture 22 COMPSCI111/111G SS 2016

Kris Gaj Research and teaching interests: ECE 646 Cryptography and Computer Network Security. Course web page: Contact: ECE 646

CS101 Lecture 24: Thinking in Python: Input and Output Variables and Arithmetic. Aaron Stevens 28 March Overview/Questions

Introduction to Programming System Design CSCI 455x (4 Units)

(Refer Slide Time 00:01:09)

CS 61C: Great Ideas in Computer Architecture. Direct Mapped Caches

Basic Computer Programming for ISNE. Santi Phithakkitnukoon ผศ.ดร.ส นต พ ท กษ ก จน ก ร

Instructor. Mehmet Zeki COSKUN Assistant Professor at the Geodesy & Photogrammetry, Civil Eng. (212)

CS270 Computer Organization Fall 2017

Introduction to Computer Systems

Exploring Python Basics

Transcription:

CSC 015: FUNDAMENTALS OF COMPUTER SCIENCE I Lecture 1: Class Introduction DR. BO TANG ASSISTANT PROFESSOR HOFSTRA UNIVERSITY 1 9/7/16 CSC15 - Python

OUTLINE What is Computer Science? What is this Class about? Introduction to Computer Systems Overview of Programming Language

WHAT IS COMPUTER SCIENCE (CS) CS is the study of how to write computer programs (programming)?? No. Programming is a big part of CS, but it is not the most important part. CS is posing a problem in such a way that a computer can help us solve it. CS is the study of algorithms to solve problems with their hardware (Computer Design) and software (Programming) realizations.

WHY CS: I The computer is incredibly fast, accurate, and stupid. Man is unbelievably slow, inaccurate, and brilliant. The marriage of the two is a force beyond calculation. -Leo Cherne

WHY CS: II Everybody in the country should learn how to program a computer... Because it teaches you how to think. -Steve Jobs

WHY CS: III CS connects to other fields: Mathematics: closely-related to CS, theory of computation, equation solutions, etc. Physics: Hypothesis testing, simulation, experimental data processing, etc. Biology: data collection, data analysis, etc. Robotics: computer vision, path planning, autonomous control, etc. Electrical Engineering: computer-aided design (CAD), simulation, embedded systems, etc.

WHAT IS THIS CLASS ABOUT? The purpose is to use programming language as a tool to solve the problems: Develop a basic understanding of computer programming; Master a very high-level computer programming language: Python; Develop problem solving skills with computer program design. 7

WHAT IS THIS CLASS ABOUT? Topics will be covered in this class: # Topic* # of Weeks 1 Introduction to Computer Systems 0.5 2 Variables, Expressions, Data Types 1.5 3 Control Flow: Conditions and Loops 1 4 File Operations 1 5 Array, List 2 6 Function Calls 2 7 Recursion 1 8 Algorithm Design I 1.5 9 Algorithm Design II 1.5 10 Introduction to Object-Oriented Design 2 8

WHAT YOU NEED FOR THIS CLASS Instructor: Office Hrs: Labs: Dr. Bo Tang Bo.Tang@HOFSTRA.EDU Adams 104 Tuesday 1:00 PM 2:00 PM Adams 204 Account & Your Own Laptop Text: John M. Zelle, Python Programming an Introduction to Computer Science (2e) Slides: in Blackboard. 9

YOUR LAPTOP! CPU >1.0Ghz RAM >1GB Disk Space >1GB Install Python 2.7: https://www.python.org/ Windows Mac OS Linux Other Platforms

GRADING POLICY: I Grading Two Midterm Exams (Open Book) ~30% Midterm I: Early Oct. Midterm II: Early Nov. Final Exam (Open Book) ~20% Early December Assignments (12-13) ~50% Due date specified in Blackboard Note: including mini-projects Grades will be posted on Blackboard Must submit email request for change of grade within one week after grades posted (for each assignment)

GRADING POLICY: II Final Letter Grade will be determined by A = 91 to 100 or top 10% of class, A- = 85 to 90 or top 20% of class, B+ = 80 to 84 or top 30% of class, B = 75 to 79 or top 40% of class, B- = 70 to 74 or top 50% of class, C+ = 65 to 69 or top 60% of class, C = 60 to 64 or top 70% of class, C- = 55 to 59 or top 80% of class, D = 45 to 54, F = below 45. Note: You will get A if your final score is 88, but in top 10% of class. You will get F if and only if your final score is below 45.

LATE POLICY Late Penalty Tabular 1 day* late 20% 2 day late 40% 3 day late 60% 4 day late 80% 5 day late 100% * Day Business Day (Holiday Excluded, Sick Day with Documents excluded) Example: Jack s HW1 is 2 days late and scores 80 out of 100 points. What s the final points he receives for HW1? 80 points * (1-40%) = 48points.

INTRODUCTION TO COMPUTER SYSTEMS Computers: Hardware Software

INTRODUCTION TO COMPUTER SYSTEMS Computers: Hardware Software Functional View of a Computer

INSIDE THE CPU Fetch-Execute Cycle First load the instruction sets to instruction cache from memory Fetch an instruction from the cache Decode the instruction to see what it represents Appropriate action carries out. Next instruction fetches, decodes, and executes. repeat!

INTRODUCTION TO COMPUTER SYSTEMS Computers: Hardware Software

PROGRAMMING LANGUAGE: I Programming is to write the instructions that the computer will follow. High-level computer languages Designed to be used and understood by humans: C, C++, Java, Python, etc. Low-level language Understood by human, but difficult to design: Assembly. Machine Language Only be understood by CPU.

PROGRAMMING LANGUAGE: II Example: Add two numbers Low-level language (Assembly): Load the number from memory location 2001 into the CPU (mov ax, 2001) Load the number from memory location 2002 into the CPU (mov bx, 2002) Add the two numbers in the CPU (add ax, bx) Store the result into location 2003 (mov 2003, ax) Machine language: A set of binary numbers (1 s and 0 s)

PROGRAMMING LANGUAGE: III High-level language: c = a + b This needs to be translated (via compilers or interpreters) into machine language that the computer can execute. Python that we will learn in this class is a very highlevel programming language. Vocabulary à Key words (just a few) Grammar à Syntax: expressions, data structures, etc.

WHAT IS A PROGRAM A program is a sequence of instructions that specifies how to perform a computation. Basic instructions appear in about every language: input: get data from keyboard, a file, or some devices output: Display data on the screen or send data to a file. math: perform basic mathematical operations conditional execution: check for certain conditions and execute particular sequence of statements. repetition: perform some actions repeatedly, usually with some variation.

INTRODUCTION TO PYTHON When you start Python, you will see something like: Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>>

INTRODUCTION TO PYTHON The >>> is a Python prompt indicating that Python is ready for us to give it a command. These commands are called statements. >>> print("hello, world ) Hello, world >>> print(2+3) 5 >>> print("2+3=", 2+3) 2+3= 5 >>>

INTRODUCTION TO PYTHON Usually we want to execute several statements together that solve a common problem. One way to do this is to use a function. >>> def hello(): name = raw_input( Please enter your name: ) msg = Hello + name +. Welcome to CSC15! print(msg)

INTRODUCTION TO PYTHON def hello(): name = raw_input( Please enter your name: ) msg = Hello + name +. Welcome to CSC15! print(msg) qbeginning of the definition of a function called hello

INTRODUCTION TO PYTHON def hello(): name = raw_input( Please enter your name: ) msg = Hello + name +. Welcome to CSC15! print(msg) qraw_input( ) is a function to take user s input, and the quoted information is displayed. qname is an example of a variable. Here, it stores user s input. qa variable is used to assign a name to a value so that we can refer to it later.

INTRODUCTION TO PYTHON def hello(): name = raw_input( Please enter your name: ) msg = Hello + name +. Welcome to CSC15! print(msg) qmsg is a new variable that constructs a new string with the value of name.

INTRODUCTION TO PYTHON def hello(): name = raw_input( Please enter your name: ) msg = Hello + name +. Welcome to CSC15! print(msg) qprint() is a function causing Python to print a message.

INTRODUCTION TO PYTHON >>> def hello(): name = raw_input( Please enter your name: ) msg = Hello + name +. Welcome to CSC15! print(msg) Notice that nothing has happened yet! We ve defined the function, but we haven t told Python to perform the function! A function is invoked by typing its name. >>> hello() Please enter your name: Jack Hello Jack. Welcome to CSC15! >>> When we exit the Python prompt, the functions we ve defined cease to exist! Use module files or scripts that are saved on disk.

INTRODUCTION TO PYTHON # File: hello.py # A simple program asks name and print hello msg # Input and Output def hello(): name = raw_input( Please enter your name: ) msg = Hello + name +. Welcome to CSC15! print(msg) hello()

INTRODUCTION TO PYTHON # File: hello.py # A simple program asks name and print hello msg # Input and Output qlines that start with # are called comments qintended for human readers and ignored by Python qpython skips text from # to end of line

INTRODUCTION TO PYTHON def hello(): name = raw_input( Please enter your name: ) msg = Hello + name +. Welcome to CSC15! print(msg) hello () qthis last line tells Python to execute the code in the function hello.

SUMMARY: COMPUTER SYSTEMS Hardware: Input/output devices, CPU, Memory, Hard Disks, etc. Software: Programming/coding to provide instructions to computer. Example of hello.py illustrates how the program take user s input from keyboard, and output desired messages. Next Week: elements of programs (variables, expressions, operators, etc.), and practice to write Python programs.

SOMETHING YOU NEED TO KNOW WHEN YOU START PROGRAMMING 1. You learn by doing. (The only way to get better at programming). 2. Programming isn t like studying for a test. 3. Let go of your emotions. 4. Trying to understand everything is a lost cause. 5. A right way to ask for help: a) Explain exactly what you think should be happening b) Explain exactly what is actually happening c) Explain why you think it should be working differently. 6. You don t need to be a math genius.

SOMETHING YOU NEED TO KNOW WHEN YOU START PROGRAMMING 7. It is ok to admit what don t know. 8. Programmers never stop learning. 9. Make the computer think like a human. Ken Mazaika, Quora.com