Notes
Slide Show
Outline
1
CS110
Introduction to Programming
  • Lecture 1
  • January 27, 2004
  • Ethan Bolker
  •  Philosophy
  • Bank: user interface, Java, object model
  •  Programming environment
  •  Homework 1
  •  Start now!


  • www.cs.umb.edu/cs110
2
Announcements
  • These slides are available on course web page
  • Hand in questionnaire on your way out
  • Discussion sections meet regularly in Purple Lab, upper garage level in Healey library
  • Purple lab PCs have been configured for CS110
  • Other lab computers will be ready soon – I will let you know when
  • Passwords for homework turnin web site available at next class
3
Learning to program
  • Lots of fun
  • Practical
  • Hard, time consuming
  • Unusual mixture:
    • sophisticated intellectual content
    • picky details that must be right
  • Exercise in reading, writing, thinking
  • CS110 is for CS majors, future professionals
4
Teaching/learning style
  • To learn a language well,  live in a land where it’s spoken – anxiety producing, but efficient!
  • Learn to write by to reading and writing and writing about what you learn
  • 60% of a lot is more than 100% of a little
  • Ask questions (to slow me down)



5
Computers and programs
  • Computer: a machine that can simulate many different machines
    • word processor    traffic light controller
    • internet shopping site    bank ATM      …
  • Program: the instructions that tell a computer how to act like some particular machine
  • Example: Bank simulation
    • user interface (how the program behaves)
    • object model (the program’s architecture)
    • Java implementation (the program itself)

6
Bank simulation - user interface
  • a:\> java Bank [Enter, CR]
  • Welcome to Engulf and Devour
  • Account number (1 or 2), 0 to shut down: 1
  • Transactions: exit, help, deposit, withdraw, balance
  • transaction: balance
  • 200
  • transaction: deposit
  • amount: 799
  • transaction: balance
  • 999
  • transaction: exit
  • Account number (1 or 2), 0 to shut down: 0
  • Goodbye from Engulf and Devour


  • a:\>
7
Bank simulation - object model
program architecture
8
Why Java?
  • Fashionable, modern (for good reasons)
  • Object oriented: when you have designed the architecture a program almost writes itself
  • Portable: the same Java code turns any computer (PC, mac, server) into a Bank
  • Well designed:
    • consistent user interface
    • easy to learn
    • hard to make serious mistakes
    • prebuilt objects plug into your programs

9
Send object a message
Bank.java (lines 101ff)

10
Bank simulation
Objects responding to messages
11
Bank simulation
Objects responding to messages
12
Software development cycle
  • imagine
  • design
  • edit
  • compile
  • run, test
  • imagine the next release ...
13
emacs
  • The programmer’s editor (word processor)
  • Learning emacs is as important as learning Java
  • You will live inside emacs in this course
  • XEmacs installed on all lab PCs,               available free for home machines
  • Start using it today – tutorial linked from course home page
14
Homework 1
  • Handed out in class, on course web page
  • Part 1 – get started
    • Hard copy due at the next class
    • Send email
    • Explore course web page
    • Understand rules about honesty
    • Write about what you find – use emacs
  • Part 2 -  jump in to Java
    • Collected electronically Tuesday Feb 3
    • Play with Bank simulation
    • Improve Bank simulation
    • Write about your coding and testing
15
Start now!
  • Turn in questionnaire as you leave class
  • Sections meet in Purple lab (Library upper level)
  • Today: begin hw1
    • send email!  (any lab)
    • explore web page www.cs.umb.edu/cs110 (any lab)
    • begin using XEmacs (Purple lab)
  • I will be in my office (S-3-179) today until 4, tomorrow 12-2:30