ch02 - Chapter 2: Introduction to Programming 1 Chapter...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 2: Introduction to Programming 1 Chapter Learning Objectives 2 Installation Installing JES and starting it up Go to http://www.mediacomputation.org and get the version of JES for your computer. If you know that you have a Java compiler (e.g., a JDK or an IDE) Windows users: Just copy the folder Double-click JES application If trouble, try jes2.bat or jes-customjava.bat Mac users: Just copy the folder Double-click JES application There is always Help Lots and lots of excellent help 3 Much of programming is about naming We name our data Data: The numbers we manipulate We call our names for data variables We name our recipes Quality of names determined much as in Philosophy or Math Enough words to describe what you need to describe Understandable (mnemonic) 4 Naming our Encodings We even name our encodings Sometimes referred to as types Numbers without decimals are called integers. Numbers with decimal points are called floating point or floats. Collections of letters (characters) are called strings . Some programming languages are strongly typed A name has to be declared to have a type, before any data is associated with it 5 Examples of Types 12 Integers Floats Strings-12 31364 0.01 12.998 34654.01 1.01 Mark Barbara Ericson 85 5 th Street NW Inside the computer, these are all just bits 6 Our programs work with a variety of names You will name your functions Just like functions you knew in math, like sine and gcd (Greatest Common Divisor) You will name your data ( variables) You will name the data that your functions work on Inputs , like the angle in sine(angle) Key: Names inside a function only have meaning while the function is being executed by the computer. (Youll see what we mean.) 7 Names for things that are not in memory A common name that youll deal with is a file name The program that deals with those is called the operating system , like Windows, MacOS, Linux A file is a collection of bytes, with a name, that resides on some external medium, like a hard disk . Think of it as a whole bunch of space where you can put your bytes Files are typed, typically with three letter extensions .jpg files are JPEG (pictures), .wav are WAV (sounds), .mp3 are MP3 (sounds) 8 We will program in JES JES : Jython Environment for Students A simple editor (for entering in our programs or recipes ): Well call that the program area A command area for entering in commands for Python to execute....
View Full Document

This note was uploaded on 02/22/2012 for the course CS 177 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 40

ch02 - Chapter 2: Introduction to Programming 1 Chapter...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online