CS 102 Computers In Context (Multimedia)‏ 01 / 23 / 2009 Instructor: Michael Eckmann.

Slides:



Advertisements
Similar presentations
CS 102 Computers In Context (Multimedia) 01 / 21 / 2009 Instructor: Michael Eckmann.
Advertisements

CS 206 Introduction to Computer Science II 01 / 20 / 2009 Instructor: Michael Eckmann.
ENGR2216 FORTRAN PROGRAMMING FOR ENGINEERS. Chapter 1 The computer CPU MEMORY INPUT/OUTPUT DEVICES DATA REPRESENTATION BINARY SYSTEM OCTAL & HEXADECIMAL.
CS 206 Introduction to Computer Science II 09 / 09 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 04 / 20 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 11 / 09 / 2007 Instructor: Michael Eckmann.
CS 330 Programming Languages 10 / 16 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 09 / 10 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 01 / 21 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 04 / 01 / 2009 Instructor: Michael Eckmann.
CS 330 Programming Languages 09 / 13 / 2007 Instructor: Michael Eckmann.
Lecture 1: Intro to Computers Yoni Fridman 6/28/01 6/28/01.
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 10 / 14 / 2009 Instructor: Michael Eckmann.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
CS 206 Introduction to Computer Science II 09 / 05 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 04 / 29 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 03 / 30 / 2007 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 03 / 25 / 2009 Instructor: Michael Eckmann.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 01 / 28 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 04 / 21 / 2010 Instructor: Michael Eckmann.
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
CS 106 Introduction to Computer Science I 02 / 23 / 2007 Instructor: Michael Eckmann.
Computer Science 101 Introduction to Programming.
TERMS TO KNOW. Programming Language A vocabulary and set of grammatical rules for instructing a computer to perform specific tasks. Each language has.
Introduction CSE 1310 – Introduction to Computers and Programming
CS 102 Computers In Context (Multimedia)‏ 01 / 28 / 2009 Instructor: Michael Eckmann.
CMPT 120 How computers run programs Summer 2012 Instructor: Hassan Khosravi.
Topics Introduction Hardware and Software How Computers Store Data
CIS Computer Programming Logic
XP Practical PC, 3e Chapter 16 1 Looking “Under the Hood”
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
CS 106 Introduction to Computer Science I 01 / 25 / 2010 Instructor: Michael Eckmann.
Chapter 2 Computer Hardware
Foundations of Computer Science Computing …it is all about Data Representation, Storage, Processing, and Communication of Data 10/4/20151CS 112 – Foundations.
Introduction to Programming Peggy Batchelor.
Data Representation and Storage Lecture 5. Representations A number value can be represented in many ways: 5 Five V IIIII Cinq Hold up my hand.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Python Types Python values are of various “types” Ints, Floats, Strings, Characters, and more Two representations of numbers 1 vs 1.0.
Bits & Bytes Created by Chris McAbee For AAMU AGB199 Extra Credit Created from information copied and pasted from
CS 206 Introduction to Computer Science II 09 / 10 / 2009 Instructor: Michael Eckmann.
Numerical Representation Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg 1.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
CS 102 Computers In Context (Multimedia)‏ 01 / 26 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 02 / 23 / 2009 Instructor: Michael Eckmann.
Introduction to Programming Instructor: Yong Tang Brookhaven National Laboratory Working on accelerator control (BNL Phone #)
Data Representation The storage of Text Numbers Graphics.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 01 / 30 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 02 / 01 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 01 / 22 / 2007 Instructor: Michael Eckmann.
CS1315 Introduction to Media Computation Introduction: Why study computer science at all?!?
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Know what a computer is used for Understand the difference between hardware and software Be able to describe the way that data is stored in a computer.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
CS 330 Programming Languages 10 / 23 / 2007 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 09 / 10 / 2007 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 04 / 27 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 01 / 22 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 01 / 24 / 2007 Instructor: Michael Eckmann.
Chapter 1: Introduction to Computer Science and Media Computation.
Basic Concepts: computer, program, programming …
Topics Introduction Hardware and Software How Computers Store Data
Key Ideas from day 1 slides
Introduction CSE 1310 – Introduction to Computers and Programming
Topics Introduction Hardware and Software How Computers Store Data
Information Technology Department
Dr. Clincy Professor of CS
Presentation transcript:

CS 102 Computers In Context (Multimedia)‏ 01 / 23 / 2009 Instructor: Michael Eckmann

Michael Eckmann - Skidmore College - CS Spring 2009 Today’s Topics Questions/comments? Chapter 1 material –What is computer science –Recipes –Programming Languages –Digital vs. Analog –Encodings

Michael Eckmann - Skidmore College - CS Spring 2009 Recipes A few observations about cooking recipes –Should be followed closely by the chef Can't use ½ cup of salt instead of a ½ cup of sugar –Steps have an order to them For example, when making breaded chicken cutlets, you need to coat the chicken with the breading mixture before frying –Some steps aren't required to be ordered For example, if a recipe says to mix a tsp of salt, a tsp of garlic powder and a tbsp of pepper it doesn't matter whether you put the salt in before the pepper and mix them up.

Michael Eckmann - Skidmore College - CS Spring 2009 Recipes A few observations about cooking recipes –It's sometimes possible to get the same exact results by following different recipes Not as true in cooking recipes as in algorithms, so the recipe analogy doesn't work perfectly here Sorting example

Michael Eckmann - Skidmore College - CS Spring 2009 Recipes Computer scientists use programming languages or pseudocode (neutral) to specify recipes (aka algorithms/programs). You may have heard of various programming languages: Java, C++, C, C#, Python, Perl, Lisp, Scheme, Prolog, Fortran, Basic,... Some languages are better suited for certain tasks than others (e.g. C is speed efficient and has the ability to make very low level calls, therefore it is good for writing Operating Systems, Java is good for portable and safe/reliable code, therefore it is good for programs that might be run on multiple platforms.)‏

Michael Eckmann - Skidmore College - CS Spring 2009 Languages Natural languages (like English) are not used to specify algorithms and programs because they are not precise enough. For example, a program written in a programming language needs to be able to mean the same thing, given the same code (sentence). In English the sentence: Time flies like an arrow. is ambiguous because it has multiple meanings (semantics) for the same syntax.

Michael Eckmann - Skidmore College - CS Spring 2009 Languages Our text uses the Python programming language for several reasons –It's popular –It's relatively easy to learn –It's relatively easy to read –It's flexible –However, it's inefficient compared to solving the same problem in say C++.

Michael Eckmann - Skidmore College - CS Spring 2009 Languages Python itself is a program (a program that interprets Python programs.)‏ Python is typically implemented in C. Jython is a python implementation in Java. –It provides a programmer with the ability to write python code and to use Java's classes Program source code (the code we write) is stored in plain text files. We could write python programs with a text editor, save them and run them with the python interpreter, however our text uses JES (Java Environment for Students) which allows entering code, debugging it and executing it. We'll use this software on Monday --- meet in HAR 207 for class.

Michael Eckmann - Skidmore College - CS Spring 2009 Digital vs. Analog Anyone know the difference?

Michael Eckmann - Skidmore College - CS Spring 2009 Digital vs. Analog Discrete values vs. Continuous Clocks Real life vs. movies Film cameras vs. digital cameras

Michael Eckmann - Skidmore College - CS Spring 2009 Encodings At the lowest, most basic level, “Computers are electronic devices that react to voltages on wires.” (page 8, in Guzdial)‏ Some positive voltage is interpreted as (is encoded as) a 1 No voltage is interpreted as (is encoded as) a 0 One “wire” can either be encoded as a 0 or a 1 (we call this a bit)‏ So, a bit can either have the value 0 or 1, nothing else.

Michael Eckmann - Skidmore College - CS Spring 2009 Encodings We often group bits together in groupings of eight, which we call a byte. A byte can have a value of – – – – – – –... –all the way up to and including – Anyone have any idea how many different patterns of 0's and 1's can be stored in a byte?

Michael Eckmann - Skidmore College - CS Spring 2009 Encodings Computer memory (and hard disk space) is made up of bytes. Has anyone heard of the memory specifications for a PC like –contains 1 Meg of RAM –This means it has 1 Megabyte (MB) of memory –Anyone know what Mega means?

Michael Eckmann - Skidmore College - CS Spring 2009 Encodings Computer memory (and hard disk space) is made up of bytes. Has anyone heard of the memory specifications for a PC like –contains 1 Meg of RAM –This means it has 1 Megabyte (MB) of memory –Anyone know what Mega means? –It means approximately 1 million –So, 1 MB is approximately 1 million bytes.

Michael Eckmann - Skidmore College - CS Spring 2009 Encodings Why is it important to us to know about bytes? A byte is one of the basic units of space in a computer ( a bit is clearly more basic as it is a single 0 or 1, but we usually use bits in chunks of 8, which is a byte.)‏ Every file (e.g. Word Document, Image file, Sound file, plain text file, software program, etc.) is encoded in bytes. Plain text files are among the easiest (for us) to understand in terms of bytes --- every character takes up 1 byte of space. –ASCII character set

Michael Eckmann - Skidmore College - CS Spring 2009 Encodings As an aside: –1 MB is approximately 1 million bytes. –I say approximately, because 1 million = 1000*1000, but 1 Meg is really 1024*1024.

Michael Eckmann - Skidmore College - CS Spring 2009 Data Types The programs we write will work with various pieces of data. Data comes in different kinds. For example, we differentiate numeric data from text data. We need to because we can do different things with numbers than we can with text. –For instance, we can add, multiply, divide, etc. with numeric data, whereas dividing text like “CS102” / “Skidmore” doesn't make any sense. Common data types: –integer – whole numbers like -89, 0, 42, 987 –float – numbers that may contain a decimal like , -2.1, 0.0, 8.0 –character strings – ordered list of characters like “Mike”, “Skidmore”, “ ”, “7”, “Hello, World!”