Print Name __________________________
Signature __________________________
Book Class Lab
Individual Assignment
10 Points
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:
|
3] Use the following main program
| main (int argc, char * argv[])
{ Book Book1, Book2 ("Algoritm II", 22222), Book3, Book4; Book1.Display();
Book1.Set("Algoritm I",
11111);
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 : // ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
|
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




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