All of the work in this project is my own!  I have not left copies of my code in public folders on university computers. I have not given any of this project to others. I will not give any portion of this project to others taking this class. I realize that the penalty for turning in work that is not my own can range from an "F" in the class to dismissal from Trinity University. 

                                                                                             Print Name  __________________________

                                                                                              Signature   __________________________


Book Class Lab
Individual Assignment
10 Points


Set Netscape Margins [ Left = 1; Right = .2; Top = .6; Bottom = .6; Select Document Title, Location,  Page Number, Page Total Black Text l]


1]  Create  program Book.cpp

2] Use the following class definition
 

class Book
{
public:
 Book (void);                   // Initialize Title to Blank and CatalogNo to 0!
 Book (char NewTitle[], int NewCatalogNo);
 ~Book (void);
 void Set (char NewTitle[], int NewCatalogNo);
 void Get(void);
 void Display(void);

private:
   char 
      Title [40];
   long int
      CatalogNo;
};

3] Use the following main program
 

main (int argc, char * argv[])
{
Book
 Book1,
 Book2 ("Algoritm II", 22222),
 Book3,
 Book4;

 Book1.Display();
 Book2.Display();
 Book3.Display();

 Book1.Set("Algoritm I", 11111);
 Book3.Set("Data Structures", 33333);
 Book4.Get();
 puts("\n\n\n=============================================\n\n\n");
 Book1.Display();
 Book2.Display();
 Book3.Display();
 Book4.Display();
 puts("Bye Bye\n\n");

 return (0);
}

4] You may not include library  iostream. You must include library stdio.h. Always document the program and each module/function/method.
 

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                                 Book.cpp                                     //
//                                                                              //
//  Purpose    :                                                                //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
 

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                                 Book.cpp                                     //
//                                                                              //
//  Purpose    :                                                                //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                          Book [Constructor]                                  //
//                                                                              //
//  Purpose    : Create and initialize a Book Object. Set the Title to blank    //
//               Set the CatalogNo to 0.                                        //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                               ~Book [Destructor]                             //
//                                                                              //
//  Purpose    : Do all that is necessary to destroy a Book Object.             //
//               In this class, nothing is necessary. Temporarily displays      //
//               cout << "Evoking Destructor ~Book(void);                       //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                                 Display Method                               //
//                                                                              //
//  Purpose    : Professionally display the Book information as follows:        //
//               Title     : The Prototcol                                      //
//               Catalog # : 11223                                              //
//               Skip a line.             .                                     //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                                   Set Method                                 //
//                                                                              //
//  Purpose    : Repaces private data member Title with NewTitle and CatalogNo  //
//               with NewCatalogNo.                                             //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
 

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                                   Get Method                                 //
//                                                                              //
//  Purpose    : Interactively prompt the user for a Title and CatalogNo. Place //
//               them into the Book Object.                                     //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
 

5] Write the code for each of the book methods/functions.

6] Do the following when program is complete.

g++ Book.cpp.cpp -o Book. <-- Binary File Will Be Called Book - Not a.out
Book > Output.txt <-- Runs the program and dumps output into file Output.txt


Setting Visual Studio Page Setup


7] Start Windows 2000 on one of the lab systems. You may use your system if you have Visual C++ installed. [In Visual Studio Package]

Setting Visual Studio Font To Courier 8 Point


6] Start Windows 2000 on one of the lab systems. You may use your system if you have Visual C++ installed. [In Visual Studio Package]

24] Copy files Book.cpp.cpp  and  Output.txt to a floppy disk.Copy files Book.cpp.cpp  and  Output.txt to a second  floppy disk. Keep one of these disks as a backup.


25] Those Labs labeled "Individual Assignment" are to be done separately by each individual. Using a pen,  each individual is to print  his/her name at the top of this document in the space provided and sign it.  Those Labs labeled "Team Assignment" may be done as a team or individually. Using a pen,  each individual on the team is to print print his/her name at the top of this document in the space provided and sign it. Submit only one copy of team assignments!

Include the following in your wire-band binder:

A] Divider

B] Copy of this assignment sheet. Using an ink pen, print your name and sign this lab at the top.

C] Listings  Book.cpp.cpp  and  Output.txt

D] Disk Containing  Book.cpp.cpp  and  Output.txt

E] Divider