Transcript slides

COMS W1004
Introduction to Computer Science
June 9, 2008
Announcements
• Homework #2 due at the beginning of class
Wednesday
– Submit a paper copy of the Theory part
– Electronic submission of Programming part
• Office hours this week
– Tomorrow: 5:30-6:30 (Milind), 7:30-8:30 (Aditi)
– Wednesday: by appointment (Chris)
Last Time
• von Neumann Architecture
• Review of binary numbers and Boolean logic
• Encoding
• Transistors, gates, and circuits
• Reading: S&G 4
Today
• Object-oriented programming
• Classes and Objects
–
–
–
–
•
•
•
•
public vs. private
encapsulation
static
scope
Writing methods: arguments and parameters
Constructors
Advice on Homework #2
Reading: L&L 4, 6.1-6.4
Advice on Homework #2
• Extra credit: You need to check two things
– The fifth and tenth characters must be dashes
– The other twelve characters must be numbers
• Security checks
– It’s okay if some logic is repeated, i.e. you
don’t use functions
– Try to use “lazy evaluation”
– The program should end as soon as it’s
determined that a check has failed