English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

//InventoryItem class file THIS IS THE CLASS FILE CPP FILE //COMING..................................
#ifndef INVENTORY_H
#define INVENTORY_H

#include
using namespace std;

class InventoryItem
{
private:
string description;
string partNo;
int qty;

public:
void setDescription(string desc)
{description = desc;}

void setPartNumber ( string pNo)
{partNo = pNo; }

void setQTY ( int q)
{ qty = q; }

string getDescription() const
{ return description;}

string getPartNumber() const
{ return partNo;}

int getQTY() const
{ return qty; }

};
#endif

2007-12-10 16:51:23 · 4 answers · asked by Shahn 2 in Education & Reference Homework Help

//InventoryItem.cpp file
#include "Inventory.h"
#include
#include
#include
using namespace std;
int main()
{nventoryItem itemList[12];
ifstream inFile;
string input, desc, pNum, qty;
int pos, start = 0, q, i=0;
inFile.open("inventory.txt");
if(!inFile)
{cout<<"Error! File not found. \n"; }
else
{cout<<"Inventory list \n";
getline(inFile, input);
while(inFile)
{//find first ','
pos=input.find(',',start);
desc=input.substr(start,pos);
start=pos + 1;
//find second ','
pos=input.find(',',start);
pNum=input.substr(start,pos-start);
start=pos + 1;
//last token
pos=input.length();
qty=input.substr(start,pos-start);
//convert to integer
q=atoi(qty.data());
//populate object
itemList[i].setDescription(desc);
itemList[i].setPartNumber(pNum);
itemList[i].setQTY(q);
//display content
cout< cout< cout< getline(inFile, input);
i++;
start = 0;
}
}
return 0;
}

2007-12-10 17:04:15 · update #1

**The previous program has nventoryItem when when it should have InventoryItem**

Anyways when I attempt to compile I get an "undeclared function" first use this function error why?

I NEED TO
DISPLAY ITEMS IN INVENTORY
ADD AN ITEM
UPDATE AN ITEM
DELETE AN ITEM
DISPLAY THE SORTED INVENTORY
LIST BY BY QUANTITY ON HAND
//*****************here is a demo list for inventory.txt**//
Hammer 10 lbs, H10PNDS, 20
Pliers 12 inch, PL12INC, 12
Axes 25 lbs, AX25PNDS, 3
Ratchet 1 cm, RAT1CENT, 1000
Drill 350 watt, D35WATT, 99
Sander 200 watt, S20WATT, 6
Tire 22 inch, TR22INC, 22
Saw 1 foot, SAW1F00T, 3
Wrench Set 14 pc, WSET14PC, 8
Adjustable Wrench 4 pc, AW4PC, 24
Airhose 20 foot, AH20FT, 23
Grinder 2 hp, GRNDR2HP, 71
//**********************demo txtfile LIst**//
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
THANKYOU
TNKS

2007-12-10 17:11:52 · update #2

reply to head hunt

I NEED TO
DISPLAY ITEMS IN INVENTORY
ADD AN ITEM
UPDATE AN ITEM
DELETE AN ITEM
DISPLAY THE SORTED INVENTORY
LIST BY BY QUANTITY ON HAND

2007-12-10 18:17:33 · update #3

PLEASE IF ANYONE CAN HELP IT WOULD BE GREATLY APPRECIATED I WILL BE AT MY COMP WORKING ON THIS FOR A WHILE
***********************************************
IF YOU NEED MORE INFORMATION PLEASE ASK ME ANYTHING!!!!!!!!
THANKS AGAIN!!!!!!!!!!!!!

2007-12-10 20:02:40 · update #4

4 answers

wtf this is jibberish

elaborate

2007-12-10 16:55:56 · answer #1 · answered by courtduck62 3 · 0 0

it incredibly is been a protracted time because of the fact I wrote C code yet won't be in a position to you in elementary terms call clrscr() in conio.h? That or in simple terms create a function that loops 50 cases and prints 'n' interior the loop. As on your integer verify, examine the enter as a char and verify to work out if the char is a extensive determination. If no longer then loop returned up and ask them to circulate right into a extensive determination returned.

2016-11-14 10:04:14 · answer #2 · answered by ? 4 · 0 0

Not gibberish...some kind of programming, right? If it was GW Basic, maybe I could pull something out of my memory bank (get it, a computer reference) but this is way out of my league. I hope someone recognizes this and can help you.

2007-12-10 16:58:04 · answer #3 · answered by Debdeb 7 · 0 0

Wat is the question? Wat do you want to do?

2007-12-10 17:52:57 · answer #4 · answered by head hunt 2 · 0 0

fedest.com, questions and answers