css161 fundamentals#of#compu3ng# …courses.washington.edu/css161/umurthy/learning... ·...

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

Upload: others

Post on 20-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

CSS  161  Fundamentals  of  Compu3ng  

Introduc3on  to  Computers  &  Java  September  26,  2012  

CSS  161:  Fundamentals  of  Compu3ng  

Instructor:  Uma  Murthy  

CSS  SKL  161  A  Instructor:  Joe  McCarthy  

Page 2: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Outline  

•  Update  /  reminder  •  Introduc3on  to  Computers  

•  Introduc3on  to  Java  

CSS  161:  Fundamentals  of  Compu3ng  

Page 3: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Updates  

•  Assigned  readings  – Any  material  in  assigned  readings    is  poten3al  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  aMer  each  class  

•  Please  complete  survey  by  Friday,  Sep  28  

CSS  161:  Fundamentals  of  Compu3ng  

Page 4: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Required  Textbook  

Absolute  Java,  5th  Edi3on    Walter  Savitch  &    Kenrick  Mock  Addison-­‐Wesley,  2013  

CSS  161:  Fundamentals  of  Compu3ng  

4th  Edi3on  OK,  too  

Page 5: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Supplemental  Material  (1/2)  

CSS  161:  Fundamentals  of  Compu3ng  

Java:  An  Introduc3on  to  Problem  Solving  &  Programming,  6th  Edi3on  Walter  Savitch  Addison-­‐Wesley,  2012  

hZp://courses.washington.edu/css161/joemcc/Notes/

SavitchCh01.pdf  

(access  via  “Notes”  link  on  course  homepage)  

Page 6: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Supplemental  material  (2/2)  

•  Prac3ce  It!  hZp://webster.cs.washington.edu:8080/prac3ceit/    

•  Instruc3ons  to  be  provided  in  the  coming  weeks  

CSS  161:  Fundamentals  of  Compu3ng  

Page 7: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Experimenta3on  via  programming  

“Do  not  be  too  3mid  and  squeamish  about  your  ac3ons.    All  life  is  an  experiment.    The  more  experiments  you  make  the  beZer.”  

-­‐  Ralph  Waldo  Emerson  

CSS  161:  Fundamentals  of  Compu3ng  

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

Page 8: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Other  introductory  CS  courses  

CSS  161:  Fundamentals  of  Compu3ng  

Page 9: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Java  

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

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

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

CSS  161:  Fundamentals  of  Compu3ng  

Page 10: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Downloading  Java  [op3onal]  

•  hZp://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)  •  hZp://www.java.com/en/download/manual_v6.jsp  •  Supported  thru  February  2013  

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

CSS  161:  Fundamentals  of  Compu3ng  

Page 11: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

CSS  161:  Fundamentals  of  Compu3ng  

Page 12: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Integrated  Development  Environments  (IDEs)  

•  Programming  tools  – Edit  text  (code)  +  compile  +  run  

– Graphical  representa3ons  of  components  

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

CSS  161:  Fundamentals  of  Compu3ng  

netbeans.org  eclipse.org  bluej.org  

Page 13: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Downloading  BlueJ  [op3onal]  

CSS  161:  Fundamentals  of  Compu3ng  

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

Page 14: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Computers  

CSS  161:  Fundamentals  of  Compu3ng  

Page 15: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Computer  Hardware  

CSS  161:  Fundamentals  of  Compu3ng  

Page 16: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Computer  Hardware  

CSS  161:  Fundamentals  of  Compu3ng  

Page 17: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Computer  SoMware  

CSS  161:  Fundamentals  of  Compu3ng  

Page 18: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Computer  SoMware  

CSS  161:  Fundamentals  of  Compu3ng  

Page 19: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

CSS  161:  Fundamentals  of  Compu3ng  

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

Page 20: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Computer  Memory  

CSS  161:  Fundamentals  of  Compu3ng  

Page 21: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Computer  Memory  

CSS  161:  Fundamentals  of  Compu3ng  

Alternate  perspec3ves:  

Key  aZributes:  addressable  /  labeled  loca3ons  that  can  store  things  

Page 22: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Computer  Disk(s)  

CSS  161:  Fundamentals  of  Compu3ng  

Page 23: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Computer  Disk(s)  

CSS  161:  Fundamentals  of  Compu3ng  

Alternate  perspec3ves:  

Page 24: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Hierarchy  of  Memory  

CSS  161:  Fundamentals  of  Compu3ng  

Variables?  

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

Page 25: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Hierarchy  of  Memory  

CSS  161:  Fundamentals  of  Compu3ng  

Variables:  •   Speed  •   Cost  •   Size  •   Vola3lity  

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

Page 26: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

CSS  161:  Fundamentals  of  Compu3ng  

Page 27: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

CSS  161:  Fundamentals  of  Compu3ng  

Page 28: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

CSS  161:  Fundamentals  of  Compu3ng  

Page 29: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

[In  Mac  OS  X  Terminal  window]  

CSS  161:  Fundamentals  of  Compu3ng  

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

Page 30: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

CSS  161:  Fundamentals  of  Compu3ng  

Page 31: CSS161 Fundamentals#of#Compu3ng# …courses.washington.edu/css161/umurthy/learning... · [CSS’422’and’CSS’430’go’into’much’further’depth]’ ... CSS#161:#Fundamentals#of#Compu3ng#

Next  3me  

•  LAB  1  on  Friday  •  Homework  1  handed  out  on  Monday  

•  Console  input  and  output  

CSS  161:  Fundamentals  of  Compu3ng