HOME | Overview | Syllabus | Instructor | Lectures | Laboratories | Readings | Assignments | Resources | Other Links
CS 1713 Lecture 13: Designing a Program From a Specification
September 29, 1999
Levels of skill being developed:

The frog problem:

In this class period we will focus on developing a program from a specification. The program we are going to develop models random walks, an important idea in statistics and in many scientific fields. (The random frog was originally proposed by Owen Astrachan in Computer Science Tapestry. See Other Links on the class web page for more information on random walks.)

A frog lives on a lily pad in LiliWorld, a straight line of lily pads stretching in two directions. The frog's home position (lily pad) is represented by 0. The frog moves in LiliWorld by tossing a coin. Heads indicates a step to the right (add one to current position) and tails indicates a step to the left (subtract one from current position). This (most intelligent) frog also keeps track of how many steps it has taken and its current position. (See class demo.)

A few methods from the predefined Math class are useful here.

The Frog class and test program as developed in class can be found at here


Objective: Design a program from start to finish.
Last revision: September 26, 1999 at 9:30 pm