The George Washington University
School of Engineering and Applied Science
Department of Computer Science

CSci 51 -- Introduction to Computing -- Fall 2001
Lab #6
For labs meeting October 9 & 10, 2001


Part 1
If you have not finished the exercise given in class on Tuesday, do so before moving on to Part 2.

Part 2
The purpose of this exercise is to give you more practice working with nested loops.

(Thanks to Chet Lund!)

The Bunny Hop is a party dance that was popular in the 1940s and 1950s. All the party guests stand in a line around the room; each guest faces the back of the previous one and holds his or her waist loosely. The music starts and the dancers follow these steps:

Step sideways with the right foot.
Bring the right foot back.
Step sideways with the right foot.
Bring the right foot back.
Step sideways with the left foot.
Bring the left foot back.
Step sideways with the right foot.
Bring the right foot back.
Step sideways with the right foot.
Bring the right foot back.
Step sideways with the right foot.
Bring the right foot back.
Hop forward one step on both feet.
Hop forward one step on both feet.
Hop forward one step on both feet.

The pattern repeats until the music stops or everyone is tired. Develop a program that prompts the user for a number of repetitions and then uses nested loops -- to the greatest extent possible --  to display that number of repetitions of the pattern.