Computer Science 252
Problem Solving with Java
Fall 2013, The College of Saint Rose
Agenda
Recall the FallingSnow example. Modify this example so that each snowflake (that is, each FallingSnow object) stops falling when it reaches the bottom of the canvas, but then remains on the canvas for 5 seconds before "melting". During this 5 seconds, the snowflake should move down by 1 pixel every half second, then get removed from the canvas as before.
Please submit only your modified file FallingSnow.java in Submission Box under "InClass10" before you leave class.
Due at the start of class, Thursday, October 17.
Please submit answers to these questions in Submission Box under "LA10" by the start of our next class. We will discuss these questions at the start of class, so no late submissions are accepted. Please be sure that your name is clearly indicated in all submissions.
Note: you may wish to submit this on paper at the start of class rather than through Submission Box.
Draw a memory diagram of the FallingSnow example. More specifically, the diagram should show the variables in existence and their values at a point after which the mouse has been clicked twice on the canvas, resulting in the creation of 2 Cloud objects. Show the situation assuming that the first Cloud is executing its run method and is in the pause statement after creating its second FallingSnow object, and the second Cloud object is executing in its constructor just before calling the start method. This means there should also be 2 FallingSnow objects in existence. Assume that the first is executing in its run method, and that the second is executing in the constructor just before calling its start method. (15 points)
Examples