Compiler say I cannot use newCDInventory as a function. Any suggestions??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lady Hill
    New Member
    • Nov 2009
    • 1

    Compiler say I cannot use newCDInventory as a function. Any suggestions??

    Code:
    #include <iostream> 
    
    using namespace std ; 
    
    // Here is the prototype for the function we will use:
    
    
    int main()
    {     
       int  currentCDStock, newCDShipment, newCDInventory,   totalCurrentCDInventory, // Integers for the main 
            cDSold, totalNewShipmentInventory ; 
       char CorX;                    // ADDED!
       bool doItOneMoreTime = true;  // ADDED!
    
        while (doItOneMoreTime) {     // ADDED!
       
       
       cout << endl ; 
       
       cout << "Inventory Program" << endl; // Print Inventory Program on the screen
       
          // The user will enter the currentCDStock and newCDShipment    
    
          cout << "Enter current number of CDs in stock:  " ;
          cin >> currentCDStock; 
    
          cout << "Enter amount of CDs received in shipment: " ;
          cin >> newCDShipment;
    {
    
          {
              int cDSold, x ;
              (x = 350) ;
              cDSold = currentCDStock - 350  ;  /* 350 represents number of CDs sold */         
          }
                   
          {            
          int TotalCDInventory, totalNewCDShipmentInventory, currentCDStock, newCDShipment, newCDInventory ;        
              
              totalCurrentCDInventory = TotalCDInventory(currentCDStock, 700); // Call function for NewCDInventory
              totalNewShipmentInventory = TotalCDInventory(newCDShipment, 500); // Call function for NewCDInventory
              newCDInventory = totalCurrentCDInventory + totalNewShipmentInventory ;
          }
         
    if (newCDInventory < 1500) ;
    
    else  ;   
        (newCDInventory > 1500) ;
      cout << "There are encough CDs in inventory and an order does not need to be made." << endl;  
      cout << "It is time to order more CDs!!!!" << endl;
    
            cout << "Enter C to do this again, or X to quit: ";      // ADDED!
            cin >> CorX;                                             // ADDED!
            if (CorX == 'X') doItOneMoreTime = false; }              // ADDED!
        
           // End of loop. Now I don't need system("PAUSE");!   :-)  // ADDED!
        
    } // End of program
    Last edited by Banfa; Nov 23 '09, 02:10 AM. Reason: Added [code] ... [/code] tags
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    If you are getting compilation errors then post them please.

    You have 1 less } than {.

    Comment

    • RRick
      Recognized Expert Contributor
      • Feb 2007
      • 463

      #3
      The last else (near (newCDInventory > 1500);) looks like it should be an "else if" statement.

      Comment

      Working...