Computer Science 120
Introduction to Programming
Spring 2011, Siena College
Lecture 4: Working with Colors; Dragging Objects
Date: Thursday, January 27, 2010
Agenda
- Announcements
- Wrap up laundry lab by Wednesday, any changes determined at
the end of class today.
- Java naming conventions
- class names: capitalize, if made up from more than one word,
capitalize each word. e.g., TouchyWindow, FramedRect,
Color.
- instance variable and method names: lower case, if made up
from more than one word, capitalize all but the first word.
e.g., onMousePress, laundry, littleRedCircle.
- named constants: all caps, if made up from more than one
word, separate words by underscore characters. e.g.,
BALL_DIAMETER, VELOCITY, START_X.
- Working with colors
- custom colors
- random colors
- Dragging graphical objects
Lecture Assignment 4
Due at the start of class, Tuesday, February 1.
Please submit answers to these questions
either as a hard copy (typeset or handwritten are OK) or by email to
jteresco AT siena.edu by the start of class. Please use a clear subject line
when submitting by email (e.g., CS 120 Lecture
Assignment 4, Joe Student). We will discuss these
questions at the start of class, so no late submissions are
accepted.
- BDM Exercise 3.7.1, p. 78.
- BDM Exercise 4.2.2, p. 98.
Examples