Beruflich Dokumente
Kultur Dokumente
manage a shop. It contains the details about the materials available in the grocery, as
And all the details related to them are computerized and can be further used at any time
of requirements. This program is capable of holding any number of billing details. And
In the second window there are five options. We can select any option as we wish.
In the first option, it is the display option. It will show the items present in the shop as
In the second option, it will ask the user to enter the number of items the user wants
In the third option, it will show the user options to choose what he wants to update.
In the fourth option, it will display the delete functionality, which item will be deleted.
The fifth option is the search window. It will show every detail of that particular item.
Program Code:
#include <string>
#include <iostream>
class ITEM
public:
char name[30];
int code;
int price;
int qty;
int n;
//this arguments will help avoid gabage in the memory of the array
// name=NULL;
price= NULL;
qty= NULL;
void insert()
cin>>name;
cin>>code;
cin>>price;
cin>>qty;
cout<<endl;
cout<<"Item code"<<'\t';
cout<<"Item name"<<'\t';
cout<<"Item price"<<'\t';
cout<<"Item quantity"<<'\t'<<endl<<endl;
cout<<code<<'\t'<<'\t';
cout<<name<<'\t'<<'\t';
cout<<price<<'\t'<<'\t';
cout<<qty<<endl;
if (code==n) //if the variable entered is similar with the code price and qty will be
deleted(NULL)
price= NULL;
qty= NULL;
void update() //the update function will allow user to change data input in the
system
int choose;
cin>>choose;
switch(choose) //using the switch case will make it more flexible for the user
case 1:
cin>>name;
}break;
case 2:
cin>>price;
}break;
case 3:
cin>>qty;
}break;
void search()
if (price!=NULL)
display();
}
}
~ITEM()
};
int main()
char name[30];
int code;
int price;
int qty;
ITEM t[100];
int options;
int n;
int i;
cin>>options;
switch(options)
if (code==n)
t[i].update;
return (options);
}break;
cin>>n;
t[i].insert();
return(options);
}break;
t[i].del();
return(options);
}break;
cin>>n;
t[i].search();
if (price!=NULL)
t[i].display();
}
return 0;