COMP1400

Programming for Designers

COMP1400 header image 2

Week 9 Lab

September 20th, 2009 · No Comments

  1. The following code features nested loops.  How many times is the ‘inner loop’ executed?  How long does the entire block of code take to execute?  What would happen to execution time if the duration for the revolving overall Ferris wheel is changed from 12 seconds to 15 seconds? 10 seconds?nested loop
  2. Give at least one significant difference between the way a Loop statement works and the way a While statement works.
  3. Exercise: Saloon Sign “An old saloon (Old West) is being converted into a tourist attraction. Use 3D text to create a neon sign to hang on the front of the balcony.  Then use a loop to make the sign blink 10 times.”
  4. Exercise: Frog and Ladybug “Create a world with a frog (Animals) and a ladybug (Animals).  Write an interactive program to allow the user to drag the ladybug around the scene.  (Use a let the mouse move objects event.) As the lady bug is dragged around, make the frog chase after it by moving one hop at a time without colliding with the ladybug.  If the user moves the ladybug within 2 meters of the frog, have the frog look at the camera and say ‘ribbit’ - then end the animation.”

Tags: Lab

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.