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 read back and list the contents of the file written by the first exercise in the previous chapter.
Extend the ReadPrimes example that you produced in this chapter to optionally display the nth prime, when n is entered from the keyboard.
Extend the ReadPrimes program further to output a given number of primes, starting at a given number. For example, output 15 primes starting at the 30th. The existing capabilities should be retained.
Write a program that will output the contents of a file to the command line as groups of eight hexadecimal digits with five groups to a line, each group separated from the next by a space.
Write a program that will allow either one or more names and addresses to be entered from the keyboard and appended to a file, or the contents of the file to be read back and output to the command line.
Modify the previous example to store an index to the name and address file in a separate file. The index file should contain each person's second name, plus the position where the corresponding name and address can be found in the name and address file. Provide support for an optional command argument allowing a person's second name to be entered. When the command-line argument is present, the program should then find the name and address and output it to the command line.