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   __________________________


Computer Class Lab
Individual Assignment
15 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 Computer.cpp

2] Use the following class definition
 

class Computer
{

public:
   Computer (char NewBrandName[]="", long int NewRamMegaBytes = 0, 
              long int NewHardDriveGigaBytes = 0, bool NewMonitor = false); 
   ~Computer (void);
   void Set (char NewBrandName[]="", long int NewRamMegaBytes = 0, 
              long int NewHardDriveGigaBytes = 0, bool NewMonitor = false);
   void Get (void);
   void Display(char Message[]="");

private:
   char 
      BrandName [40];        // Constructor Initialize to Blank 
   long int
      RamMegaBytes,          // Constructor Initialize to 0 
      HardDriveGigaBytes;    // Constructor Initialize to 0 
   bool
      Monitor;               // Constructor Initialize to false 
};

3] Use the following main program. Replace the ???? with your name.
 

main (int argc, char * argv[])
{
   cout << "############################### Start of Main #####################\n";
   cout << "                     Computer Class - Overloading Methods  \n";
   cout << "                                    written by             \n";
   cout << "                                       ????                \n\n\n";
   cout << "###################################################################\n";

Computer
   C1,
   C2("Radio Shack"),
   C3("Mac", 64),
   C4("Sun", 128, 10),
   C5("IBM", 128, 35, true),
   Systems[3];

   cout << "\n############## Check Out Constructor Initializations ############\n";
   C1.Display("Computer C1:");
   C2.Display("Computer C2:");
   C3.Display("Computer C3:");
   C4.Display("Computer C4:");
   C5.Display("Computer C5:");

   Systems[0].Display("Computer Systems[0]:");
   Systems[1].Display("Computer Systems[1]:");
   Systems[2].Display("Computer Systems[2]:");

   cout << "\n####################### Call Set Method ##########################\n";
   Systems[0].Set("Alpha");
   Systems[1].Set("Beta", 128);
   Systems[2].Set("Delta", 64, !28, true);
   C5.Set("Gamma");

   cout << "\n##################### Check Out Set Method ########################\n";
   C5.Display("Computer C5:");
   Systems[0].Display("Computer Systems[0]:");
   Systems[1].Display("Computer Systems[1]:");
   Systems[2].Display("Computer Systems[2]:");
  

  cout << "\n##################### Check Out Get Method ########################\n";
   Systems[0].Get();  // Enter Data of your choice
   Systems[0].Display("Hand Entered (Get) Computer Systems[0]:");

  
   cout << "############################### End of Main #####################\n";
   return (0);
}

4] Always document the program and each module/function/method. Make sure that your purpose is always clear.
 

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                          Computer [Constructor]                              //
//                                                                              //
//  Purpose    : Create and initialize a Computer Object. Set the Brand Name    //
//               to NewBrandName [default blank]. Set the RamMegaBytes to       //
//               to NewRamMegaBytes [default 0]. Set the HardDriveGigaBytes to  //
//               to NewHardDriveGigaBytes [default 0]. Set the NewMonitor to    //
//               to NewMonitor [default false]. Constructor has all four        //
//               overloaded with default values.                                //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
Computer::Computer (char NewBrandName[], long int NewRamMegaBytes, 
              long int NewHardDriveGigaBytes, bool NewMonitor)
{
   cout << "Evoking Destructor ~Computer(void)\n";
}

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

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                                 Display Method                               //
//                                                                              //
//  Purpose    : Professionally display the Computer information as follows:    //
//               Optional Message Line (if there is one)                        //
//               Brand Name      : IBM                                          //
//               RAM             : 128 MB                                       //
//               Hard Drive      : 35 GB                                        //
//               Monitor         : True                                         //
//               Skip a line.             .                                     //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
 

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                                   Set Method                                 //
//                                                                              //
//  Purpose   :                                                                 //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                                   Get Method                                 //
//                                                                              //
//  Purpose   :                                                                 //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

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

6] Do the following when program is complete.

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

When you redirect the output to file Output.txt, the prompts will go there as well. The program stop at the Get and you will be expected to enter the  

in what every order you selected in your Get Module - You will see no prompts!


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


8] 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] Printout Computer.cpp

D] Printout Output.txt

E] Disk containing the files.