Beginner C/C++

Moderators: None (Apply to moderate this forum)
Number of threads: 5430
Number of posts: 16951

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Project help. Please Posted by jkrege03 on 3 Jun 2007 at 10:23 AM
Hi, I'm in need of some help on a project I'm doing for a class. In this project were creating an inventory management system for a soda pop company. The menu's and initial part of the program has already been created, my job is to take three fields, sku, quantity, and price and field reports from them. I need to take one sku, and print a report listing sku and quantity, or If the user wants a total report print all skus, total quantity, and total sale price amount. If a sku is under a quantity of 24, than create a flag for that sku. Here is the code we've created for the program.

/*
*************************************************************************
* *
* Main menu and function calls for soft drink inventory *
* *
* Team project for CS218a :: Mr. Steven King *
* *
* Team Members: Andrew Gonyea, Rick Hedden, James Kreger *
* *
*************************************************************************
*/

#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include <stdio.h>
#include <time.h>
#include <vector>
#include <stdlib.h>
#define SIZE 26
using namespace std;
using std::string;

//variable definitions
int l = 0;
int i = 0;

// data structures
struct productType
{
string brand;
string flavor;
string descript;
string size;
string SKU;
double deposit;
};

productType drink[1000];

struct costType
{
string sku;
double cost;
double salePrice;
};
costType drinkCost[3000];

struct companyType
{
string VID;
string coName;
string contactName;
string address1;
string address2;
string city;
string state;
string zip;
string phone;
string fax;
};
companyType vendor[1000];

struct invenType
{
string sku;
int quantity;
};

invenType inventoryLine[1000];

void makeLine(int); // function declarations

//void updateInfo (productType drink[],companyType vendor[]);
char updateProduct(productType drink[]);
char displayProduct(productType drink[]);
char updateVendor(companyType vendor[]);
char displayVendor(companyType vendor[]);
char updateMenu();
void makeLine(int l);
char makeMenu();

///////////////////////// MAIN FUNCTION /////////////////////////////////////////////
int main ()
{
char select;
select = 'i';

//set length of line
int l;
l = 55;

//Make the main menu

while(select != 'q' && select != 'Q')
{
select = makeMenu();
if(select == 'c' || select == 'C')
{
select = 'C';
//replace the following line with the call to the check() function
cout << "\t\tBegin Inventory Check" << endl;
}

if(select == 'a' || select == 'A')
{
select = 'A';
//replace the following line with the call to the addProduct() function
cout << "\t\tBegin Inventory Addition" << endl;
}

if(select == 's' || select == 'S')
{
select = 'S';
//replace the following line with the call to the sellProduct() function
cout << "\t\tBegin Sale" << endl;
}

if(select == 'u' || select == 'U')
{
select = 'U';
char changeAnother;
changeAnother = 'R';
char updateChoice = 'q';
cout << "\t\tBegin update function: " << endl << flush;
system ("CLS");
updateChoice = updateMenu();
if(updateChoice == 'v' || updateChoice == 'V')
{
updateChoice = 'V';
cout << "\t\tBegin Vendor Update" << flush;
while(changeAnother == 'R')
{
changeAnother = updateVendor(vendor);
}
}
if(updateChoice == 'd' || updateChoice == 'D')
{
updateChoice = 'D';
cout << "\t\tDisplay Vendor data" << flush;
changeAnother = displayVendor(vendor);
}
if(updateChoice == 'r' || updateChoice == 'R')
{
updateChoice = 'R';
cout << "\t\tReport Product data" << flush;
changeAnother = displayProduct(drink);
}
if(updateChoice == 'p' || updateChoice == 'P')
{
updateChoice = 'P';
cout << "\t\tBegin Product Update" << flush;
while(changeAnother == 'R')
{
changeAnother = updateProduct(drink);
}
}
}
if(select == 'q' || select == 'Q')
{
return 0;
}
} // end while loop
return 0;
}


////////////////////// CALLED MENU FUNCTIONS ///////////////////////////////////
char makeMenu()
{
int i;
char branch;
branch = 'i';
cout << flush;
system ("CLS");
makeLine(65);

for(i=0;i<2;i++)
{
cout << endl;
}
cout << "\t\t" << "Soft-Drink-Co -:- Inventory Control System " << endl << endl;
time_t ltime;
wchar_t buf[SIZE];
errno_t err;
time( &ltime );

err = _wctime_s( buf, SIZE, &ltime );
if (err != 0)
{
printf("Invalid Arguments for _wctime_s. Error Code: %d\n", err);
}
wprintf( L"\t\tToday is %s\n", buf );

for(i=0;i<2;i++)
{
cout << endl;
}
makeLine(65);

cout << "\t\t" << "Enter a single-letter command" << endl << endl;
cout << "\t\t" << "C - Check inventory" << endl;
cout << "\t\t" << "A - Add product to inventory" << endl;
cout << "\t\t" << "S - Sell product in inventory" << endl;
cout << "\t\t" << "U - Update or display product/vendor info" << endl;
cout << "\t\t" << "Q - Quit program" << endl;
cout << endl << "\t\t" << "Please enter your selection now: ";
cin >> branch;
return branch;
}

void makeLine(int l)
{
int p;
cout << " ";
for(p=0;p<l;p++)
{
cout << "*";
}
cout << endl;
return;
}

////////////////////// CALLED APPLICATION FUNCTION ////////////////////////////
char updateMenu()
{
int i;
char branch,updateFlag;
branch = 'i';
makeLine(65);
for(i=0;i<2;i++)
{
cout << endl;
}
cout << "\t\t" << "Soft-Drink-Co -:- Inventory Control System " << endl << endl;
time_t ltime;
wchar_t buf[SIZE];
errno_t err;
time( &ltime );

err = _wctime_s( buf, SIZE, &ltime );
if (err != 0)
{
printf("Invalid Arguments for _wctime_s. Error Code: %d\n", err);
}
wprintf( L"\t\tToday is %s\n", buf );

for(i=0;i<2;i++)
{
cout << endl;
}
makeLine(65);

cout << endl << endl;
cout << "\t\tWould you like to update Vendor or Product information? " << endl;
cout << "\t\t" << "Enter a single-letter command" << endl << endl;
cout << "\t\t" << "V - Update Vendor info" << endl;
cout << "\t\t" << "D - Display Vendor data" << endl;
cout << "\t\t" << "P - Update product info" << endl;
cout << "\t\t" << "R - Report proudct info" << endl;
cout << "\t\t" << "Q - Return to main menu" << endl;
cout << endl << "\t\t" << "Please enter your selection now: ";
cin >> updateFlag;
return updateFlag;
}

//////////////////////////// Function updates Vendor Data //////////////////////
char updateVendor(companyType vendor[])
{
// declare variables
char pause;
char vendorUpdateContinue = 'Y';
char recordUpdateContinue = 'Y';
string spacer;
string searchVID;
string searchNameString;
string tempString;
int foundItem;
int choiceNum = 0;
int selectItem = 0;
int maxRecord;
int candidateRecord[20];

// define input files
ifstream vendorFile;
ofstream newVendorFile;
vendorFile.open("vendorData.txt");
if (!vendorFile) //test for presence of productFile
{
cout << "\t\tUnable to open vendor DATA file." << endl;
cout << "\t\tPlease contact developer." << endl;
cout << "\t\tThis program will end." << endl;
return 'X';
}
system ("CLS");
cin.ignore(100,'\n');
for (i = 0;i < 1000;i++)
{
getline(vendorFile,vendor[i].VID);
getline(vendorFile,vendor[i].coName);
getline(vendorFile,vendor[i].contactName);
getline(vendorFile,vendor[i].address1);
getline(vendorFile,vendor[i].address2);
getline(vendorFile,vendor[i].city);
getline(vendorFile,vendor[i].state);
getline(vendorFile,vendor[i].zip);
getline(vendorFile,vendor[i].phone);
getline(vendorFile,vendor[i].fax);
}
//vendorFile.close();
cout << "\t\tRecent vendor entries:" << endl << endl;
for (i = 0;i < 1000;i++)
{
if(vendor[i].VID.empty())
{
maxRecord = i;
i = 1000;
}
else
{
cout << "\t\t" << vendor[i].VID << "\t\t"
<< vendor[i].coName << endl;
}
}
cout << endl << "\t\tMake a note of Vendor ID before proceding. " << endl << endl << "\t\t";
system("PAUSE");
while(vendorUpdateContinue=='Y')
{
system ("CLS");
makeLine(65);
cout << endl;
cout << "\t\tEnter Vendor ID of record to change, " << endl;
cout << "\t\tor, to search by company name, enter \'??\'" << endl;
cout << "\t\tto abandon ALL changes and return" << endl;
cout << "\t\tto the main menu enter 9999." << endl << endl;
makeLine(65);
cout << endl << endl << "\t\t";
getline(cin,searchVID);
if(searchVID=="9999")
{
return 'X';
}
if(searchVID=="??") // VID unknown, search by XX*
{
system ("CLS");
makeLine(65);
cout << endl << endl;
cout << "\t\tSearch for vendor data by first three " << endl;
cout << "\t\tletters of company name or enter 9999 to" << endl;
cout << "\t\tabandon ALL changes and return to main menu." << endl;
cout << endl << endl;
makeLine(65);
cout << "\t\t";
cin.ignore(100,'\n');
getline(cin,searchNameString);
cout << searchNameString;
system ("CLS");
makeLine(65);
cout << endl;
cout << "\t\tMatching records: " << endl;
for(i=0;i < maxRecord;i++)
{
if(vendor[i].coName.substr(0,3)==searchNameString)
{
candidateRecord[choiceNum]= i;
choiceNum++;
cout << "\t\t" << choiceNum << ": " << vendor[i].coName;
}
}
makeLine(56);
if(choiceNum==0)
{
cout << endl << "\t\tNo records found." << endl;
break;
}
else if(choiceNum==1)
{
cout <<endl << "\t\tJust one company matches search: " << vendor[0].coName << endl;
foundItem = 0;
}
cout << endl;
cout << "\t\tEnter the line number of the record you want to update: ";
cin >> selectItem;
foundItem = candidateRecord[selectItem];
}
for(i=0;i<1000;i++)
{
if(vendor[i].VID==searchVID)
{
foundItem = i;
i = maxRecord;
}
}
while(recordUpdateContinue=='Y')
{
system ("CLS");
makeLine(65);
cout << endl << endl;
cout << "\t\t1. " << vendor[foundItem].VID << endl;
cout << "\t\t2. " << vendor[foundItem].coName << endl;
cout << "\t\t3. " << vendor[foundItem].contactName << endl;
cout << "\t\t4. " << vendor[foundItem].address1 << endl;
cout << "\t\t5. " << vendor[foundItem].address2 << endl;
cout << "\t\t6. " << vendor[foundItem].city << endl;
cout << "\t\t7. " << vendor[foundItem].state << endl;
cout << "\t\t8. " << vendor[foundItem].zip << endl;
cout << "\t\t9. " << vendor[foundItem].phone << endl;
cout << "\t\t10. " << vendor[foundItem].fax << endl;
cout << endl;
makeLine(65);
cout << "\t\tEnter the line number you would like to update" << endl;
cout << "\t\tor enter 0 to abandon changes and return to menu.\t\t ";
cin >> selectItem;
cin.ignore(100,'\n');
switch (selectItem)
{
case 0:
break;
case 1:
{
cout << "\t\tEnter new data for "
<< "Vendor ID: ";
getline(cin,vendor[foundItem].VID);
break;
}
case 2:
{
cout << "\t\tEnter new data for "
<< "Vendor company name: ";
getline(cin,vendor[foundItem].coName);
break;
}
case 3:
{
cout << "\t\tEnter new data for "
<< "Vendor contact name: ";
getline(cin,vendor[foundItem].contactName);
break;
}
case 4:
{
cout << "\t\tEnter new data for "
<< "Vendor address line 1: ";
getline(cin,vendor[foundItem].address1);
break;
}
case 5:
{
cout << "\t\tEnter new data for "
<< "Vendor address line 2: ";
getline(cin,vendor[foundItem].address2);
break;
}
case 6:
{
cout << "\t\tEnter new data for "
<< "Vendor city: ";
getline(cin,vendor[foundItem].city);
break;
}
case 7:
{
cout << "\t\tEnter new data for "
<< "Vendor state: ";
getline(cin,vendor[foundItem].state);
break;
}
case 8:
{
cout << "\t\tEnter new data for "
<< "Vendor zip code: ";
getline(cin,vendor[foundItem].zip);
break;
}
case 9:
{
cout << "\t\tEnter new data for "
<< "Vendor phone: ";
getline(cin,vendor[foundItem].phone);
break;
}
case 10:
{
cout << "\t\tEnter new data for "
<< "Vendor Fax: ";
getline(cin,vendor[foundItem].fax);
break;
}
} // end of switch strucure
cout << endl << "\t\tMake additional changes to same record? (y/n) ";
cin.ignore(100,'\n');
cin >> recordUpdateContinue;
} // end record update while loop
cout << endl << "\t\tMake changes to a different record? (y/n) ";
cin >> vendorUpdateContinue;
if(vendorUpdateContinue == 'y' || vendorUpdateContinue == 'Y')
{
vendorUpdateContinue = 'Y';
}
} // end of OTHER WHILE loop
/////////////////// routine saves vendor data file
newVendorFile.open("VendorData.txt");
for(i=0; i<1000; i++)
{
if(vendor[i].VID.empty())
{
i = 1000;
break;
}
else
{
newVendorFile << vendor[i].VID << endl
<< vendor[i].coName << endl
<< vendor[i].contactName << endl
<< vendor[i].address1 << endl
<< vendor[i].address2 << endl
<< vendor[i].city << endl
<< vendor[i].state << endl
<< vendor[i].zip << endl
<< vendor[i].phone << endl
<< vendor[i].fax << endl;
}
} // end of new vendor data file write loop
newVendorFile.close();
return 'X';
}
/////////////////// routine displays vendor data //////////////////////
char displayVendor(companyType vendor[])
{
// declare variables
char vendorUpdateContinue = 'Y';
char vendorDisplayContinue = 'Y';
char recordUpdateContinue = 'Y';
char recordDisplayContinue = 'Y';
string spacer;
string searchVID;
string searchNameString;
string tempString;
int foundItem;
int choiceNum = 0;
int selectItem = 0;
int maxRecord;

// define input files
ifstream vendorFile;
ofstream newVendorFile;
vendorFile.open("vendorData.txt");
if (!vendorFile) //test for presence of productFile
{
cout << "\t\tUnable to open vendor DATA file." << endl;
cout << "\t\tPlease contact developer." << endl;
cout << "\t\tThis program will end." << endl;
return 'X';
}
system ("CLS");
cin.ignore(100,'\n');
for (i = 0;i < 1000;i++)
{
getline(vendorFile,vendor[i].VID);
getline(vendorFile,vendor[i].coName);
getline(vendorFile,vendor[i].contactName);
getline(vendorFile,vendor[i].address1);
getline(vendorFile,vendor[i].address2);
getline(vendorFile,vendor[i].city);
getline(vendorFile,vendor[i].state);
getline(vendorFile,vendor[i].zip);
getline(vendorFile,vendor[i].phone);
getline(vendorFile,vendor[i].fax);
}
//vendorFile.close();
cout << "\t\tRecent vendor entries:" << endl << endl;
for (i = 0;i < 1000;i++)
{
if(vendor[i].VID.empty())
{
maxRecord = i;
i = 1000;
}
else
{
cout << "\t\t" << vendor[i].VID << "\t\t"
<< vendor[i].coName << endl;
}
}
cout << endl << "\t\tMake a note of Vendor ID before proceding. " << endl << endl << "\t\t";
system("PAUSE");
while(vendorDisplayContinue=='Y')
{
system ("CLS");
makeLine(65);
cout << endl;
cout << "\t\tEnter Vendor ID of record to display or \"9999\" to quit: " << endl << endl;
makeLine(65);
cout << endl << endl << "\t\t";
getline(cin,searchVID);
if(searchVID=="9999")
{
return 'X';
}
for(i=0;i<1000;i++)
{
if(vendor[i].VID==searchVID)
{
foundItem = i;
i = 1000;
}
}
system ("CLS");
makeLine(65);
cout << endl << endl;
cout << "\t\tV.I.D. : " << vendor[foundItem].VID << endl;
cout << "\t\tCo Name: " << vendor[foundItem].coName << endl;
cout << "\t\tName : " << vendor[foundItem].contactName << endl;
cout << "\t\tAdd1 : " << vendor[foundItem].address1 << endl;
cout << "\t\tAdd2 : " << vendor[foundItem].address2 << endl;
cout << "\t\tCity : " << vendor[foundItem].city << endl;
cout << "\t\tState : " << vendor[foundItem].state << endl;
cout << "\t\tzip : " << vendor[foundItem].zip << endl;
cout << "\t\tphone : " << vendor[foundItem].phone << endl;
cout << "\t\tfax : " << vendor[foundItem].fax << endl;
cout << endl;
makeLine(65);
cout << endl << "\t\tDisplay a different record? (y/n) ";
cin >> vendorDisplayContinue;
} // end of Display Vendor WHILE loop

newVendorFile.close();
return 'X';
}

/////////////////////////////////Update Product Data///////////////////////
char updateProduct(productType drink[])
{
// declare variables
char productUpdateContinue = 'Y';
string spacer;
string searchSKU;
string tempString;
int foundIndex;

// define input files
ifstream productFile;
ofstream newProductFile;
productFile.open("productData.txt");
if (!productFile) //test for presence of productFile
{
cout << "\t\tUnable to open product DATA file." << endl;
cout << "\t\tPlease contact developer." << endl;
cout << "\t\tThis program will end." << endl;
return 'X';
}
system ("CLS");
for (i = 0;i < 1000;i++)
{
getline(productFile,drink[i].brand);
getline(productFile,drink[i].flavor);
getline(productFile,drink[i].descript);
getline(productFile,drink[i].size);
getline(productFile,drink[i].SKU);
productFile >> drink[i].deposit;
getline(productFile,spacer);
}
productFile.close();
while(productUpdateContinue=='Y')
{
makeLine(65);
cout << endl;
cout << "\t\tEnter SKU of product to update, " << endl;
cout << "\t\tor, to abandon ALL changes and return" << endl;
cout << "\t\tto main menu, enter 999." << endl;
cout << endl;
makeLine(65);
cout << endl << endl << endl << "\t\tSKU: " ;
cin >> searchSKU;

if(searchSKU=="999")
{
return 'X';
}
for (i = 0; i < 1000;i++)
{
if(drink[i].SKU == searchSKU)
{
foundIndex = i;
cout << endl << "\t\tRecord found for " << searchSKU << flush << endl;
i = 1000;
break;
}
if(drink[i].SKU.empty())
{
i = 1000;
cout << endl << "\t\tSKU not Found. Try Again." << endl;
continue;
}
}
char action = 'n';
makeLine(65);
cout << endl << endl;
cout << "\t\t1. Brand name : " << drink[foundIndex].brand << endl;
cout << "\t\t2. Flavor : " << drink[foundIndex].flavor<< endl;
cout << "\t\t3. Description : " << drink[foundIndex].descript<< endl;
cout << "\t\t4. Size : " << drink[foundIndex].size<< endl;
cout << "\t\t5. SKU : " << drink[foundIndex].SKU<< endl;
cout << "\t\t6. Deposit AMT : " << drink[foundIndex].deposit<< endl;
cout << endl << endl;
makeLine(65);
cout << endl << "\t\tEnter line number (1-6) to edit," << endl;
cout << "Q to quit, or K to delete entire product: ";
cin >> action ;
if(action=='q' || action=='Q')
{
productUpdateContinue='N';
continue;
}
if(action=='k' || action == 'K')
{
char confirm;
cout << "\t\tAre you SURE? Deletion will be permanent. (y/n) ";
cin >> confirm;
if (confirm=='Y' || confirm == 'y')
{
drink[foundIndex].SKU = "DELETED";
}
}
if(action=='1')
{
cout << endl << "\t\tEnter new brand for SKU: " << drink[foundIndex].SKU << flush << endl;
cin.ignore(256,'\n');
getline(cin,tempString);
drink[foundIndex].brand = tempString;
}
if(action=='2')
{
cout << endl << "\t\tEnter new flavor for SKU:" << drink[foundIndex].SKU << endl;
cin.ignore(256,'\n');
getline(cin,tempString);
drink[foundIndex].flavor = tempString;
}
if(action=='3')
{
cout << endl << "\t\tEnter new description for SKU:" << drink[foundIndex].SKU << endl;
cin.ignore(256,'\n');
getline(cin,tempString);
drink[foundIndex].descript=tempString;
}
if(action=='4')
{
cout << endl << "\t\tEnter new size for SKU:" << drink[foundIndex].SKU << endl;
cin.ignore(256,'\n');
getline(cin,tempString);
drink[foundIndex].size=tempString;
}
if(action=='5')
{
cout << endl << "\t\tEnter new SKU to replace SKU:" << drink[foundIndex].SKU << endl;
cin.ignore(256,'\n');
getline(cin,tempString);
drink[foundIndex].SKU=tempString;
}
if(action=='6')
{
cout << endl << "\t\tEnter new deposit amount for SKU:" << drink[foundIndex].SKU << endl;
cin >> drink[foundIndex].deposit;
}
char closeSave = 'n';
cout << endl << "\t\tSave changes to file (y) or abandon changes (n)?";
cin >> closeSave;
if(closeSave == 'y' || closeSave == 'Y')
{
cout << "\t\tAre you sure? Changes will be final. (y/n)";
cin >> closeSave;
if(closeSave == 'y' || closeSave == 'Y')
{
newProductFile.open("productData.txt");
for(i=0;i<1000;i++)
{
if(drink[i].SKU.empty())
{
i = 1000;
newProductFile << endl << "\t\tSKU not Found. Try Again." << endl;
continue;
}
newProductFile << drink[i].brand << endl
<< drink[i].flavor << endl
<< drink[i].descript << endl
<< drink[i].size << endl
<< drink[i].SKU<< endl
<< drink[i].deposit << endl;
}
newProductFile.close();
}
}
}
// end of while loop

return 'X';
}
//////////////////////////// display product data ////////////////////////////
char displayProduct(productType drink[])
{
// declare variables
char productDisplayContinue = 'Y';
string spacer;
string searchSKU;
string tempString;
int foundIndex;

// define input files
ifstream productFile;
ofstream newProductFile;
productFile.open("productData.txt");
if (!productFile) //test for presence of productFile
{
cout << "\t\tUnable to open product DATA file." << endl;
cout << "\t\tPlease contact developer." << endl;
cout << "\t\tThis program will end." << endl;
return 'X';
}
system ("CLS");
for (i = 0;i < 1000;i++)
{
getline(productFile,drink[i].brand);
getline(productFile,drink[i].flavor);
getline(productFile,drink[i].descript);
getline(productFile,drink[i].size);
getline(productFile,drink[i].SKU);
productFile >> drink[i].deposit;
getline(productFile,spacer);
}
productFile.close();
while(productDisplayContinue=='Y')
{
makeLine(65);
cout << endl;
cout << "\t\tEnter SKU of product to display, " << endl;
cout << "\t\tor, to quit, enter 999." << endl;
cout << endl;
makeLine(65);
cout << endl << endl << endl << "\t\tSKU: " ;
cin >> searchSKU;

if(searchSKU=="999")
{
return 'X';
}
for (i = 0; i < 1000;i++)
{
if(drink[i].SKU.empty())
{
i = 1000;
cout << endl << "\t\tSKU not Found. Try Again." << endl;
continue;
}
if(drink[i].SKU == searchSKU)
{
foundIndex = i;
i = 1000;
}
}
char action = 'n';
makeLine(65);
cout << endl << endl;
cout << "\t\t1. Brand name : " << drink[foundIndex].brand << endl;
cout << "\t\t2. Flavor : " << drink[foundIndex].flavor<< endl;
cout << "\t\t3. Description : " << drink[foundIndex].descript<< endl;
cout << "\t\t4. Size : " << drink[foundIndex].size<< endl;
cout << "\t\t5. SKU : " << drink[foundIndex].SKU<< endl << flush;
cout << "\t\t6. Deposit AMT : " << drink[foundIndex].deposit<< endl;
cout << endl << endl;
makeLine(65);

cout << endl << "\t\tWould you like to display another product? (y/n) ";
cin >> productDisplayContinue;
if(productDisplayContinue=='n' || productDisplayContinue=='N')
{
productDisplayContinue = 'N';
}
}
return 'R';
}



My programming skill's are not the best, so bear with me.

Here's my section so far
i list the functions

void reportline;

int findsku;
string itm = 0;
int index;
int found;
found = false;
int i;
cout << "Please enter in sku or type 0 for all skus";
cin >> findsku;

now do I use fstream here or can I just use

for (findsku=0; findsku<nextopen;findsku++
{
if(strcmp(invenType[inventoryLine[index].sku,itm)==0);
{found=1;
break;
}
}
break;

if inventoryLine.quantity <= 5;
cout << findsku << quantity << endl;
}

InventoryLine [1000]
int maxRecord;
#include fstream;
open inventoryType.inventoryLine;

for (i=0; i <1000, i++)
{
getline(inventFile.inventoryLine[i].sku;
getline(inventFile.inventoryLine[i].quantity;
if inventoryLine[i].sku== " ";
{
maxRecord= i;
i = 1000;
}


Please any help would be recommended, I get so frustrated and lost on this stuff.

Report
Re: Project help. Please Posted by MT2002 on 3 Jun 2007 at 11:48 AM

Two suggestions...

a) Please use [code]*code here*[/code] when posting. Thanks

b) Splitting the code accross multiple files will make it easier to read,
modify, and expand upon. It will also make this project *much* easier
as you can focus on one section at a time.

Also, posting large code blocks isnt very effeciant. You can upload
your files as an attacment to help make the posts look nicer.
Report
Re: Project help. Please Posted by stober on 3 Jun 2007 at 3:33 PM
another suggestion: you described what the program is supposed to do but you did not say anything about what problem(s) you are having. Since we can't read your mind you will have to describe the problems in some detail.
=============================================
never lie -- the government doesn't like the competition. (Author unknown)
Report
Re: Project help. Please Posted by jkrege03 on 3 Jun 2007 at 5:45 PM
I need help in evaluating my code at the bottom, and suggesting what is the proper code to finish it. I know I need help on what I'm supposed to do to finish my section.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.