Intro to Programming -- Wednesday of 1st Week
What is programming?
- Writing a computer program (set of instructions).
What is a program?
- A written document that a computer can read, interpret, and act on as a
set of instructions.
- Humans must be able to read it too!
Rhetorical Styles:
- OOP (Object-oriented programming)
- OOD (Object-oriented design, analogous to outline, storyboard)
Language:
- Java (audience: computer, human(s))
- Object Diagrams
Development Environment:
- Eclipse (can also use BlueJ)
- (see diagrams)
What is a program?
In OOP, a running program is a collection of objects that
work together to perform a task.
- What is an object?
- How do they work together?
Object = State + Operations
State:
- info about the object
- parts it is composed of
- attributes that make this object different from others like it, e.g., color,
material, size
- state between operations, e.g., open/closed, running/still
- list of other objects with which it interacts and communicates, e.g., list
of contents
Operations:
- tasks involving this object
- what you do to an object, e.g., open it, close it, move it
- what you ask an object to do, e.g., tell me your color, your size, your
location; move yourself, open up, add this to your list of contents
- special operations: constructors
What is a Class?
- describes state and operations for one or more objects (a class, or category,
of objects)