Computer Science 120
Introduction to Programming
Spring 2012, Siena College
Lecture 4: Working with Colors; Dragging Objects
Date: Thursday, January 26, 2012
Agenda
- Announcements
- Lab discussion
- Look at the grading sheet: "Appropriate Comments", "Good
Variable Names", "Appropriate formatting" are worth as much
as the correctness for the first two parts!
- Use BlueJ's "Auto-layout" tool - you should never lose a
formatting point
- Ways to approach finding the correct basket
- Programming Project 1
- 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, January 31.
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 (2 points).
- BDM Exercise 4.2.2, p. 98 (4 points).
Examples