Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,176 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,983 people online right now. Registration is fast and FREE... Join Now!




Source file not compiled

 
Reply to this topicStart new topic

Source file not compiled

tatman3389
14 Dec, 2007 - 11:49 AM
Post #1

New D.I.C Head
*

Joined: 14 Dec, 2007
Posts: 3


My Contributions
I have downloaded code for the first time and opened in Dev-++. The code states that it is for C++ however when i compile and run the programme i get a message saying ' source code not complied'.

What as a newcomer, am i doing wrong????

Many thanks
Matt
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Source File Not Compiled
14 Dec, 2007 - 12:00 PM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,450



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(tatman3389 @ 14 Dec, 2007 - 12:49 PM) *

I have downloaded code for the first time and opened in Dev-++. The code states that it is for C++ however when i compile and run the programme i get a message saying ' source code not complied'.

What as a newcomer, am i doing wrong????

Many thanks
Matt

Without seeing the code... it's hard to say.

User is online!Profile CardPM
+Quote Post

tatman3389
RE: Source File Not Compiled
14 Dec, 2007 - 12:12 PM
Post #3

New D.I.C Head
*

Joined: 14 Dec, 2007
Posts: 3


My Contributions
QUOTE(no2pencil @ 14 Dec, 2007 - 01:00 PM) *

QUOTE(tatman3389 @ 14 Dec, 2007 - 12:49 PM) *

I have downloaded code for the first time and opened in Dev-++. The code states that it is for C++ however when i compile and run the programme i get a message saying ' source code not complied'.

What as a newcomer, am i doing wrong????

Many thanks
Matt

Without seeing the code... it's hard to say.


Sorry,

here it is
CODE

class carsandvans                // class specification
    {
   private:
      int carsOnHand;         // cars on hand
      int vansOnHand;         // vans on hand
   public:
      void displayData()         // display cars and vans
     {
     cout << "\n   Cars = " << carsOnHand;
     cout << "\n   Vans = " << vansOnHand;
     }
      void SoldOnecar()          // record sale of one car
     {
     --carsOnHand;
     --vansOnHand;
     }
      void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


    void displayData()         // display cars and vans
     {
     cout << "\n   Cars = " << carsOnHand;
     cout << "\n   Vans = " << vansOnHand;
     }
      void SoldOnecar()          // record sale of one car
     {
     --carsOnHand;
     --vansOnHand;
     }
      void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }

    void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


    void SoldOnecar()          // record sale of one car
     {
     --carsOnHand;
     --vansOnHand;
     }
      void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


     int carsOnHand;         // cars on hand
      int vansOnHand;         // vans on hand
   public:
      void displayData()         // display cars and vans
     {
     cout << "\n   Cars = " << carsOnHand;
     cout << "\n   Vans = " << vansOnHand;
     }
      void SoldOnecar()          // record sale of one car
     {
     --carsOnHand;
     --vansOnHand;
     }
      void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


     int vansOnHand;         // vans on hand
   public:
      void displayData()         // display cars and vans
     {
     cout << "\n   Cars = " << carsOnHand;
     cout << "\n   Vans = " << vansOnHand;
     }
      void SoldOnecar()          // record sale of one car
     {
     --carsOnHand;
     --vansOnHand;
     }
      void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


  void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }



hope this helps, thanks for looking
Matt
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Source File Not Compiled
14 Dec, 2007 - 12:16 PM
Post #4

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,450



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
1st code.gif
2ndly, I see two void main() functions. Can't have two functions of the same name, let alone two main functions!
User is online!Profile CardPM
+Quote Post

tatman3389
RE: Source File Not Compiled
14 Dec, 2007 - 12:39 PM
Post #5

New D.I.C Head
*

Joined: 14 Dec, 2007
Posts: 3


My Contributions
QUOTE(no2pencil @ 14 Dec, 2007 - 01:16 PM) *

1st code.gif
2ndly, I see two void main() functions. Can't have two functions of the same name, let alone two main functions!


Sorry. I hope this makes more sense.

Thanks


CODE


class carsandvans                // class specification
    {
   private:
      int carsOnHand;         // cars on hand
      int vansOnHand;         // vans on hand
   public:
      void displayData()         // display cars and vans
     {
     cout << "\n   Cars = " << carsOnHand;
     cout << "\n   Vans = " << vansOnHand;
     }
      void SoldOnecar()          // record sale of one car
     {
     --carsOnHand;
     --vansOnHand;
     }
      void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


CODE


    void displayData()         // display cars and vans
     {
     cout << "\n   Cars = " << carsOnHand;
     cout << "\n   Vans = " << vansOnHand;
     }
      void SoldOnecar()          // record sale of one car
     {
     --carsOnHand;
     --vansOnHand;
     }
      void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


CODE


    void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


CODE


     void SoldOnecar()          // record sale of one car
     {
     --carsOnHand;
     --vansOnHand;
     }
      void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


CODE


     int carsOnHand;         // cars on hand
      int vansOnHand;         // vans on hand
   public:
      void displayData()         // display cars and vans
     {
     cout << "\n   Cars = " << carsOnHand;
     cout << "\n   Vans = " << vansOnHand;
     }
      void SoldOnecar()          // record sale of one car
     {
     --carsOnHand;
     --vansOnHand;
     }
      void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


CODE

     int vansOnHand;         // vans on hand
   public:
      void displayData()         // display cars and vans
     {
     cout << "\n   Cars = " << carsOnHand;
     cout << "\n   Vans = " << vansOnHand;
     }
      void SoldOnecar()          // record sale of one car
     {
     --carsOnHand;
     --vansOnHand;
     }
      void initData()            // set initial quantities
     {
     cout << "\n   Enter cars on hand: ";
     cin >> carsOnHand;
     cout << "   Enter vans on hand: ";
     cin >> vansOnHand;
     }
   };  // end of carsandvans class

   /////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }


CODE


/////////////////////////////////////////////////////////////
   void main()
      {
      char choice = 'x';         // user's letter choice
      clrscr();
      carsandvans shop1;        // create car shop objects
      carsandvans shop2;
      carsandvans shop3;
                 // set initial data
      cout << "\nInitialize data for shop 1";
      shop1.initData();
      cout << "\nInitialize data for shop 2";
      shop2.initData();
      cout << "\nInitialize data for shop 3";
      shop3.initData();

      while(choice != 'q')       // loop until user enters 'q'
     {
     cout << "\nEnter shop number, or q to quit: ";
     cin >> choice;
     switch(choice)
        {
        case '1':
           cout << "Selling a car at shop 1";
           shop1.SoldOnecar();
           break;
        case '2':
           cout << "Selling a car at shop 2";
           shop2.SoldOnecar();
           break;
        case '3':
           cout << "Selling a van at shop 3";
           shop3.SoldOnecar();
           break;
        }  // end switch
     }  // end while
                 // display current data
      cout << "\nSupplies on hand at shop 1";
      shop1.displayData();
      cout << "\nSupplies on hand at shop 2";
      shop2.displayData();
      cout << "\nSupplies on hand at shop 3";
      shop3.displayData();
      getch();
      }

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/2/08 12:53AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom