Computer Science 202
Introduction to Programming

Fall 2013, The College of Saint Rose

Lab 5: A Loopy Drawing
Due: 11:59 PM, Tuesday, November 5, 2013

Your task in lab for this week is to use Objectdraw graphics primitives and some while and for loops to create a picture. The picture you generate is up to you - it just needs to meet the requirements listed later in this document.

You may work alone or with a partner on this lab.

There is no formal design document to be graded this week, but you are strongly encouraged to begin, as usual, with pencil and paper sketching out a plan before you start coding.

Program Requirements

The picture created by your program must meet the following minimum requirements. You are welcome to go beyond these requirements, but be sure you have not missed any required element before working on extensions.

  1. Your program should be substantially new code. That is, you may borrow from class examples but your drawing should not be an incremental change to one or more class examples - it should be something new.
  2. You should use at least two while or for loops (could be one of each) to draw repeated components of your drawing.
  3. Your program should draw its picture in at least three phases: part of the drawing should happen when the program starts, the next part the first time the mouse is pressed, the next part when the mouse is pressed a second time, etc.
  4. Your program should reset to the initial picture (before any mouse presses occurred) when the mouse exits the window.

Here is an example of a program that meets these requirements:



Again, feel free to go beyond this but be sure your program meets these minimal requirements.

Submitting Your Work

Before 11:59 PM, Tuesday, November 5, 2013, submit your Java program for grading. There are three things you need to do to complete the submission: (i) upload a copy of your Java program (the .java file only) using Submission Box under assignment "LoopyDrawing", (ii) print a copy of your program and hand it to your instructor, and (iii) demonstrate the execution of your program for your instructor (2-day grace period for demos).

Don't forget to check your programs for compliance with the Style Guide for CSC 202 Programs before you submit!

Grading

This assignment is worth 50 points, which are distributed as follows:

> FeatureValueScore
Style, Design, and Efficiency
Appropriate comments 3
Good variable names 2
Appropriate variable declarations 4
Good use of constants 4
Appropriate formatting 1
Does not generate new objects unnecessarily 2
Good overall design 4
Program Requirements
First repeated component using a while/for loop 5
Second repeated component using a while/for loop 5
Part of drawing drawn immediately 5
Part of drawing added on first mouse press 5
Part of drawing added on second mouse press 5
Drawing reverts back to original on mouse exit 5
Total 50