You can download the source code for the examples in the book and the solutions to the following exercises from http://www.wrox.com.

Write a program to display a random choice from a set of six choices for breakfast (you could use any set; for example, scrambled eggs, waffles, fruit, cereal, toast, or yogurt).

When testing whether an integer is a prime, it is sufficient to try to divide by integers up to the square root of the number being tested. Rewrite the program example from this chapter to use this approach.

A lottery requires that you select six different numbers from the integers 1 to 49. Write a program to do this for you and generate five sets of entries.

Write a program to generate a random sequence of capital letters that does not include vowels.

Start Free Trial

No credit card required