Objectives:
Section
11.4 in your text explains how to declare and initialize an array.
Also, a field in a class may be an array of values.
| Assignment: Define a class Slideshow which has two arrays as fields: an array of pictures, and an array of sounds. The constructor for this class will let users pass two arrays when creating a new Slideshow object. The class will have a method show() that plays the slideshow. It should display each picture in its array, one at a time. While the picture is showing, your object should play the corresponding sound file. Write a main
program which builds two arrays, creates a Slideshow object, and
plays the slideshow. |