CS 101 - Introduction to Computing, Spring 2007

Spring 2007

Homework 5 - Adding Background Music

3% Extra Credit

Due: Wednesday, May 9, 2007 at 11:59 pm

This extra credit assignment is similar to lab 11. The biggest difference is that the background music volume will change at different times during the final sound object.

You are to write a function called addBackground () that will take two parameters. The first parameter will be the foreground sound object. The second parameter will be the background sound object. This function must return a new sound object that combines these two sound objects as follows:

Thus the new sound object will be 8 seconds longer than the original forground sound object. If the background sound object is not long enough, simply have it repeat as namy times as needed.

Submitting Your Project

Your code must be commented and written in good programming style. You are to submit your final program to the digital drop box on the CS 101 Blackboard site.