26.07.2013 Views

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 22 <strong>Java</strong> Media Framework and <strong>Java</strong> Sound (on CD) 1345<br />

22.40 (Knight’s Tour Walker) Develop multimedia-based versions of the Knight’s Tour programs<br />

you wrote in Exercises 7.22 and 7.23.<br />

22.41 (Pinball Machine) Here’s another contest problem. Develop a <strong>Java</strong> program that simulates a<br />

pinball machine of your own design. Have a contest with your classmates <strong>to</strong> develop the best original<br />

multimedia pinball machine. Use every possible multimedia trick you can think of <strong>to</strong> add “pizzazz”<br />

<strong>to</strong> your pinball game. Try <strong>to</strong> keep the game mechanisms close <strong>to</strong> those of real pinball games.<br />

22.42 (Roulette) Study the rules for the game of roulette and implement a multimedia-based version<br />

of the game. Create an animated spinning roulette wheel. Use audio <strong>to</strong> simulate the sound of the ball<br />

jumping the various compartments that correspond <strong>to</strong> each of the numbers. Use an audio <strong>to</strong> simulate<br />

the sound of the ball falling in<strong>to</strong> its final slot. While the roulette wheel is spinning, allow multiple<br />

players <strong>to</strong> place their bets. When the ball lands in its final slot, you should update the bank accounts<br />

of each of the players with the appropriate wins or losses.<br />

22.43 (Craps) Simulate the complete game of craps. Use a graphical representation of a craps table.<br />

Allow multiple players <strong>to</strong> place their bets. Use an animation of the player who is rolling the dice and<br />

show the animated dice rolling eventually <strong>to</strong> a s<strong>to</strong>p. Use audio <strong>to</strong> simulate some of the chatter around<br />

the craps table. After each roll, the system should update the bank accounts of each of the players depending<br />

on the bets they have made.<br />

22.44 (Morse Code) Modify your solution <strong>to</strong> Exercise 10.26 <strong>to</strong> output the morse code using audio<br />

clips. Use two different audio clips for the dot and dash characters in Morse code.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!