Computer Science 120
Introduction to Programming
Fall 2011, Siena College
Lecture 7: Defining Classes
Agenda
- Announcements
- Laundry labs back
- SkiBall lab
- Who started by defining named constants and writing comments?
- Beware: count++; vs. count = count++;
- Potentially helpful method for a Location:
translate (see BDM Exercise 5.1.1, p. 125, which
is part of the next lecture assignment)
- Spring Flowers lab is up
- Defining classes
- Local variables and scope rules
Lecture Assignment 7 [Breimer only]
Due at the start of class, Monday, Sept 26.
Please submit answers to these questions
as a hard copy (typeset or handwritten are OK) by the start of class.
- BDM Exercise 3.4.2, p. 72.
- BDM Exercise 4.8.5, p. 116.
- BDM Exercise 4.8.7, p. 117.
- BDM Exercise 4.8.8, p. 117.
- BDM Exercise 5.1.1, p. 125.
- BDM Exercise 5.4.2, p. 133.
Examples