Assignment 6 – Wacky Sentences
Maximum Points = 50
(Due before class on April 9, 2008) The purpose of this assignment is to use loops and arrays in Java to manipulate sounds. In this assignment, you will use:
“Wacky Sentences” are sentences of three of more words that are randomly constructed from at least three lists of words. An example of a text-based wacky sentence is Program 111 (pg. 419-420). Your program is going to create one or more wacky sentences using the actual sounds.
Write a Java program that
3 C:/mediasources/dog.wav C:/mediasources/cat.wav C:/mediasources/book.wav |
NOTE 1: Make sure the Sound holding the “sentence” is “big” enough to hold the combined sounds. Remember to include “silence” between sounds.
NOTE 2: Your program will need to use the Scanner class to read the data from each file:
Scanner scan = new Scanner (new File(fileName));.
You will need to include throws IOException (see program 118 (page 451) after each method that reads from a file or use a try-catch block (see program 102 (pages 397-399). File I/O requires import java.io.*; in addition to import java.util.Scanner;
NOTE 3: You may need throws SoundException to handles the creation of the Sounds.
NOTE 4: Lab 37 (http://csc.ColumbusState.edu/summers/NOTES/1301/labs/lab37.htm) covers some of the material for IO and try-catch.
Submit the .java file containing your program.
Grades are determined using the following scale: