17-Assignment-3-More-Java

17-Assignment-3-More-Java - CS106A Handout 17 Spring 2011...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS106A Handout 17 Spring 2011 April 18 th , 2011 Assignment 3: Bizz Bazz Buzz and Screen Savers This week we’re going to try out a new assignment emphasizing decomposition, random value generation, animation, simple mouse event detection, and image manipulation. The programs we’re writing are increasingly complex, and eventually your assignments will be to write a large single program exercising some new concepts. This week, however, I want to have you write one small-medium program and one medium-big program as a stepping- stone to the assignment that’ll go out a week from today. The first of the two programs is conceptually straightforward, but I map out a decomposition scheme that we expect you to use. In particular, I actually name the methods you should implement in order so that you arrive at a working solution more quickly than you might otherwise had I asked you to choose your own decomposition scheme. The second program—probably the more entertaining of the two—is more open-ended in that I don’t fully dictate how you should decompose your solution. The program is large enough that you absolutely must write some helper methods, but how you do that is largely up to you. Note that this assignment is due three days prior to your April 28 th midterm. That should give you enough time to review your thoughts and prepare for the exam. You’re of course welcome to take a late day, but that means the assignment deadline moves in on the exam date, so do so only if you’ll submit more polished work and feel better about the material. Due: Monday, April 25 th at 5:00 p.m. Program 1: Bizz Bazz Buzz Bizz Bazz Buzz is a multi-player game where everyone sits in a circle ala duck-duck-goose and counts off consecutive numbers in a round robin manner. One person says 1, the person next to him says 2, the person next to her says 3, and so on in one big, merry loop. Play continues until someone either takes too long or makes a mistake, and the person who messes up leaves the circle and play resumes with those who remain. Now, counting off numbers if fairly easy. The game’s twist: whenever you get to a number that’s a multiple of 3, 5, or 7 and/or includes any one of those three digits, you don’t say the number itself, but you say something else. The rules outlined below dictate what you should say instead:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
If the number is a multiple of 3 and/or the digit 3 appears one or more times, then you don’t say the number. Instead, you say the word "bizz" if it’s a multiple of three, and you say "bizz" for every 3 that appears. For example: o You wouldn’t say 13. You’d say "bizz", because 13 contains a single 3. o You wouldn’t say 233; you’d instead say "bizz bizz", because 3 appears twice. o
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/28/2011 for the course CS 106A taught by Professor Sahami,m during the Spring '08 term at Stanford.

Page1 / 8

17-Assignment-3-More-Java - CS106A Handout 17 Spring 2011...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online