Summary

Your programs are beginning to take on more challenging and interesting dimensions. You have added some very useful tools to your bag of tricks in this chapter. You learned how to store and load plain text files. You learned how to use file streams, stream readers, and stream writers to manipulate files. You added menu structures–complete with hotkeys, shortcuts, and multiple levels– to your programs. You learned how the standard dialogs can query the user for fonts, colors, and file names. You practiced binary object serialization to store entire objects to files. You put all these things together in an interesting multiform application.

NOTE

CHALLENGES

  • Add a Save feature to the game editor. Save usually works just like Save As if the file has not yet been saved. However, if the program recognizes a file name for the current file, it automatically saves that file without calling up a dialog box.

  • Add menus to the Visual Critter program from Chapter 6, “Creating a Windows Program.”

  • Modify the Mini Adventure program (the game where you added words to a text file) from Chapter 1Basic Input and Output: A Mini Adventure,” so that it can read a text file from a disk. Allow the user to put in special tags (such as <noun>). When the program encounters a tag, have it ask for a noun and place it in a variable. Perhaps add an editor so that the player can save and load multiple stories.

  • Add object serialization to the Snowball Fight program from Chapter 5, Constructors, Inheritance, and Polymorphism.” Allow the user to modify various characteristics of a robot-controlled fighter. Then store and load these objects to the drive system.

  • Extend the Serialization Demo program in this chapter to be a small database. Extend the Contact class so that it has the properties you want, and build a class like Dungeon to store a list of contacts.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.200.220