Wyo C++ Ch. 10 Programming Assignment

Ch10Proj1.cpp

Create a struct definition for an object that you may want to use in future programs or sell to other software developers for use in their programs. The object that you define can be from fantasy (a character in a videogame or intelligent AP Statistics student) or it can be modelled on something that is real and part of your life (e.g. your toothbrush, your mother but not your computer science teacher). The member variables for the struct definition must be private and there must be at least one int member variable and at least one apstring member variable. The struct definition should have public member functions including a default constructor, another constructor that accepts one or more parameters, an accessor for each member variable, and at least one modifier. Type your struct definition in a .h header file which should be saved in your ClassFiles network folder. Then, implement your struct definition by typing out its member functions and save that implementation file in your ClassFiles network folder with a .cpp extension. Finally, write a main function in Ch10Proj1.cpp that instantiates and makes use of several objects of your struct type. Each member function must be called at least once in your program. Try to provide some kind of purpose for your program so that it's not too trivial. You must also create a free function named toString and place it below your main function in Ch10Proj1.cpp. The toString function should be passed an object of your struct type by reference and it should cout (i.e. display) each member variable of the struct object when it is called (by calling accessors of course) in a manner that someone could read the name of each private member variable and its corresponding value.

Not only will I be executing your Ch10Proj1.cpp file for a runtime grade, but I will also be "including" your .h header file and your .cpp implementation file into a source function of my own through the network to instantiate and manipulate your objects!

Your program must follow the Coding Standards. Save the source code file as "Ch10Proj1.cpp" in the appropriate network folder.

You must hand in the following printouts stapled in this order:

1. Ch10Proj1.cpp source code
2. your .h header file
3. your .cpp implementation file