css 161 fundamentals of computing introduction to computers & java september 26, 2012 css 161:...

31
CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL 161 A Instructor: Joe McCarthy

Upload: sibyl-terry

Post on 31-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

CSS 161Fundamentals of Computing

Introduction to Computers & JavaSeptember 26, 2012

Instructor: Uma Murthy

CSS SKL 161 A Instructor: Joe McCarthy

Page 2: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Outline

• Update / reminder• Introduction to Computers• Introduction to Java

Page 3: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Updates

• Assigned readings– Any material in assigned readings

is potential fodder for exams, regardless of whether we cover it in a lecture, lab or assignment

• Slides will always be posted on web site– Typically, shortly after each class

• Please complete survey by Friday, Sep 28

Page 4: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Required Textbook

Absolute Java, 5th Edition Walter Savitch & Kenrick MockAddison-Wesley, 2013

4th Edition OK, too

Page 5: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Supplemental Material (1/2)

Java: An Introduction to Problem Solving & Programming, 6th EditionWalter SavitchAddison-Wesley, 2012

http://courses.washington.edu/css161/joemcc/Notes/SavitchCh01.pdf

(access via “Notes” link on course homepage)

Page 6: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Supplemental material (2/2)

• Practice It!http://webster.cs.washington.edu:8080/practiceit/

• Instructions to be provided in the coming weeks

Page 7: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Experimentation via programming

“Do not be too timid and squeamish about your actions. All life is an experiment. The more experiments you make the better.”

- Ralph Waldo Emerson

Corollary: All programs are experiments.The more programs you make the better.

Page 8: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Other introductory CS courses

Page 9: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Java

• Goal:– Write once, run anywhere– JDK: Java Developers Kit– JRE: Java Runtime Environment

• Editions– SE: Standard Edition– EE: Enterprise Edition– ME: Micro Edition (mobile, embedded)– Embedded: flash memory, closed systems

• Versions– 1.0 (1992), .. 1.6 (2006), 1.7 (2011)

Page 10: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Downloading Java [optional]

• http://www.java.com/getjava/– Current: Version 7 update 7 (1.7u7)• On Mac, requires Mac OS X 10.7.3 or higher

– Can also use Version 6 update 35 (1.6u35)• http://www.java.com/en/download/manual_v6.jsp• Supported thru February 2013

• We will be writing Java, so we want JDK– Which includes JRE

Page 11: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Page 12: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Integrated Development Environments(IDEs)

• Programming tools– Edit text (code) + compile + run– Graphical representations of components

• We’ll be using BlueJ, but you can use others

netbeans.orgeclipse.orgbluej.org

Page 13: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Downloading BlueJ [optional]

http://www.bluej.org/download/download.html

Page 14: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Computers

Page 15: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Computer Hardware

Page 16: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Computer Hardware

Page 17: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Computer Software

Page 18: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Computer Software

Page 19: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Note: program must be loaded into memory in order to execute

Page 20: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Computer Memory

Page 21: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Computer Memory

Alternate perspectives:

Key attributes: addressable / labeled locations that can store things

Page 22: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Computer Disk(s)

Page 23: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Computer Disk(s)

Alternate perspectives:

Page 24: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Hierarchy of Memory

Variables?

[CSS 422 and CSS 430 go into much further depth]

Page 25: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Hierarchy of Memory

Variables:• Speed• Cost• Size• Volatility

[CSS 422 and CSS 430 go into much further depth]

Page 26: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Page 27: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Page 28: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Page 29: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

[In Mac OS X Terminal window]

localhost:code umurthy$ ls FirstProgram*FirstProgram.javalocalhost:code umurthy$ javac FirstProgram.java Localhost:code umurthy$ ls FirstProgram*FirstProgram.class FirstProgram.javaLocalhost:code umurthy$ java FirstProgramHello reader.Welcome to Java.Let's demonstrate a simple calculation.2 plus 2 is 4Localhost:code umurthy$

Page 30: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Page 31: CSS 161 Fundamentals of Computing Introduction to Computers & Java September 26, 2012 CSS 161: Fundamentals of Computing Instructor: Uma Murthy CSS SKL

CSS 161: Fundamentals of Computing

Next time

• LAB 1 on Friday• Homework 1 handed out on Monday• Console input and output