SUNY Geneseo Department of Computer Science


Object Oriented Programming Concepts, Part 2

{Date}

CSci 141, Fall 2003
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture


Misc

CodeWarrior problems with robot

CS Learning Center

Questions?

Turn in labs today -- any time, preferably into my hand

Intro to Design

(Chapter 2)

Expressions as algorithms for computing values

Values -- objects can contain them in member variables

Mini-Assignment:

Design an algorithm for the robot described in the book that makes the robot move forward until it comes to a wall.

Preconditions: no obstacles between robot and the wall

Version 1:

Version 2:

Version 3:

    loop while robot can move
        move

Version 4, finally, is Java Code

Postcondition: robot is on tile before wall, still facing in original direction

What does this exemplify from the reading?

Next

Introduction to Theory

Consider making change using the fewest coins:

Suppose there was 4-cent coin, 8 cents change

Read Sections 3.1 - 3.3 and 3.5


Next Lecture