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
Comment