CS 140 - Homework 7 - Due Thursday April 23

In this homework you are going to extend our particle simulator to add a horizontal middle wall that is exactly halfway down the y-axis, its length is one third the width of the window and is centered. Every particle needs to bounce off of the wall. Your simulator should also ask the user how many particles they want to simulate.

Requirements

  1. You should prompt the user for the number of particles to simulate.
  2. Particles should bounce off each other (we should have gotton this working in class).
  3. There should be a horizontal wall that particles bounce off of cleanly without leaving any "splotch" marks.
  4. Make the particles a random diameter between 20 and 40 pixels.
  5. Make sure this is turned in a folder named HW7 in your student folder.
  6. Hint: Write a method in your Particle class named bounceInnerWall that bounces one particle off of the inner wall. This method will then be called from your Program class.

You can run my version of the program by double clicking on run.bat in the folder

T:/Harcourt/Fall2008/CS140/HW7/