Exceptions

1. An MP3 player has a battery and a play list of songs. Every time the MP3 player plays a song, the batteries charge is reduced by an amount proportional to the length of the song. When the charge is low, the MP3 player must recharge the battery. If the battery has been recharged too many times, it must be replaced.

Here's the design:

Implement and test this design using exceptions to tell the MP3 player when the battery is low or shot.