Inventory Management System Project in C++ is available for download.
Functional Requirements of Inventory Management System
The functional requirements of this General store Management System In C++ are listed below:
Module 1: Dealer’s login Module
The system user has to give the correct or valid password to use the system and the password is 12 times a. for example aaaaaaaaaaaa.
Module 2: Employee’s login Module
In this module, The system user has to give the correct or valid password to enter into the Employee menu.
Module 3: Refill Inventory or stocks Module
The system user can refill the inventory or stock easily for that the system user needs to input or provide product name, price, and quantity.
Module 4: View Inventory or stocks Module
In this module, the customer can view the inventory or stock from the customer’s menu.
Module 5: Add/Delete products Module
The system user can add new product details to the general store management system also the product details can be removed if no longer needed.
Module 6: Purchase Items Module
whenever the customer purchases some items from the general store, the customer menu is activated.
Note: Password to login the program is 12 times a.
Password = aaaaaaaaaaaa
C++ Source code of Inventory Management System Project
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 |
#include<iostream> #include<string.h> #include<conio.h> #include<math.h> #include<fstream> using namespace std; int i,n; ifstream fin; ofstream fout; fstream fio; void disp(); class stock { char name[20],pass[15]; float pr; int quant; public: void get(); void get2(); void show(); int stchk(char nm[30]); void withd(int qty); void refil(int qty); }st; void stock::withd(int qty) { if(quant>=qty) { quant-=qty; cout<<"\n\nStock updated.\n"; cout<<"\n\nTotal price to be paid:"<<pr*qty; } else cout<<"\n\nInsufficient stock"; getch(); } void stock::refil(int qty) { quant+=qty; cout<<"\n\nStock updated."; getch(); } int stock::stchk(char nm[30]) { if(strcmp(nm,name)==0) return 0; else return 1; } void stock::get() { cin>>name>>pr>>quant; /*cout<<"\n\nEnter the password letter by letter\n"; for(int z=0;z<5;z++) { cin>>pass[z]; system("cls"); cout<<"\n\nEnter the password letter by letter\n"; for(i=1;i<=(z+1);i++) { cout<<"*"; } } if(strcmp(pass,"hello")==0) { cout<<"\nCongrats!!Access Granted!!\n\n"; cout<<"\nEnter the Name followed By the price and then by the quantity\n"; cin>>name>>pr>>quant; } else cout<<"Access Denied!!";*/ } void stock::get2() { cin>>name>>quant; } void stock::show() { cout<<"\n"<<name<<"\t\t\t"<<quant<<"\t\t\t"<<pr; } void addnew() { // cout<<"\n\n\nCongrats!!Access Granted!!\n\n"; system("cls"); //cout<<"\nEnter the Name followed By the price and then by the quantity\n"; disp(); getch(); system("cls"); cout<<"\nEnter the No. of Products that you wish to add: "; cin>>n; if (n!=0) { int j,l,sum=0; fout.open("shop.dat",ios::binary|ios::app); for(i=0;i<n;i++) { /*if(i==0) { system("cls"); }*/ cout<<"\n\nInput the name, price and the quantity of item respectively\n\n"; st.get(); fout.write((char*)&st,sizeof(st)); cout<<"\n\nitem updated"; cin.get(); } cout<<"\n\nStock Updated!!"; fout.close(); cin.get(); system("cls"); disp(); } else { fout.close(); cin.get(); system("cls"); cout<<"\n\nNo items to be added"; } } void withdraw() { system("cls"); char temp[100];int qty; int i=0; long pos=0; disp(); cout<<"\n\nEnter the product's name \n"<<endl; cin>>temp; cout<<"\n\nEnter quantity: \n"<<endl; cin>>qty; fio.open("shop.dat",ios::binary|ios::out|ios::in); while(fio) { pos=fio.tellp(); fio.read((char*)&st,sizeof(st)); if(st.stchk(temp)==0) { st.withd(qty); fio.seekp(pos); fio.write((char*)&st,sizeof(st)); i++;break; } } if(i!=1) cout<<"\n\n!!Record not found!!"; fio.close(); cin.get(); system("cls"); disp(); getch(); } void disp() { int i=1; cout<<"\n=================================================================="; cout<<"\n\n=================\tTHE STOCK ITEMS ARE\t=================="; cout<<"\n\n==================================================================\n"; cout<<"\n\nPARTICULARS\tSTOCK AVAILABLE\t\t\t PRICE"; cout<<"\n\n============================================================\n"; fin.open("shop.dat",ios::binary); while(!fin.eof()) { fin.read((char*)&st,sizeof(st)); if(!fin.eof()) { if(fin.tellg()<0) { i=0; break;} st.show(); } } if(i==0) { cout<<"\n\n\t\t\t!!Empty record room!!"; getch(); } fin.close(); } void refill() { system("cls"); char temp[100];int qty; int i=0; long pos=0; disp(); cout<<"\n\nEnter the products name \n"<<endl; cin>>temp; cout<<"\n\nEnter quantity: \n"<<endl; cin>>qty; fio.open("shop.dat",ios::binary|ios::out|ios::in); while(fio) { pos=fio.tellp(); fio.read((char*)&st,sizeof(st)); if(st.stchk(temp)==0) { st.refil(qty); fio.seekp(pos); fio.write((char*)&st,sizeof(st)); i++;break; } } if(i!=1) cout<<"\n\n!!Record not found!!"; fio.close(); system("cls"); cin.get(); disp(); cin.get(); } void remove() { system("cls"); int i=0; char temp[30]; cout<<"\n\t\t\t\tDelete Record"; cout<<"\n\nEnter the name of the product:"; cin>>temp; fout.open("temp.dat",ios::binary); fin.open("shop.dat",ios::binary); while(!fin.eof()) { fin.read((char*)&st,sizeof(st)); if(!fin.eof()) if(st.stchk(temp)==0) { st.show(); cout<<"\n\n\t\tRecord deleted"; i++; } else fout.write((char*)&st,sizeof(st)); } if(i==0) cout<<"\n\n!!Record not found!!"; fin.close(); fout.close(); remove("shop.dat"); rename("temp.dat","shop.dat"); } int main() { char pass[10],pass2[10]; int i,j; cout<<"\n\n\t|============ WELCOME TO STORE inventory MANAGEMENT ============|"; getch(); system("cls"); cout<<"\n\t\t STORE inventory MANAGEMENT SYSTEM\n"; cout<<"=========================="; cout<<"\n\n\t\t 1. Dealer Menu\n\n\t\t 2. Customer Menu\n\n\t\t 3. Employee Menu"; cout<<"\n\n============================\n"; cout<<"\n\nEnter Your Choice:"; cin>>j; if(j==1) { system("cls"); /*disp(); cout<<"\n\n\n\nEnter the No. of Products that you wish to add: "; cin>>n;*/ system("cls"); cout<<"\n\n\n\n\n\n\n\t\t\t\t\tPlease enter the password: "; for(int z=0;z<12;z++) { pass[z]=getch(); system("cls"); cout<<"\n\n\n\n\n\n\n\t\t\t\t\tPlease enter the password: "; for(i=1;i<=(z+1);i++) { cout<<"*"; } } if(strcmp(pass,"aaaaaaaaaaaa")==0) { /*cout<<"\n\n\nCongrats!!Access Granted!!\n\n"; getch();*/ system("cls"); dealermenu: system("cls"); cout<<"=================="; cout<<"\n\n\t\t\t DEALER MENU\n1. Add new product\n2. Display stock\n3. Refill\n4. Remove an item\n5. Exit:"; cout<<"\n\n\n===========END OF MENU============="; cout<<"\n\n Enter your Choice :\t"; cin>>i; if(i==1) { addnew();getch(); goto dealermenu; } else if(i==2) { system("cls"); disp();getch();goto dealermenu; } else if(i==3) { refill();goto dealermenu; } else if(i==4) { remove();getch();goto dealermenu; } else { system("cls"); getch(); exit(0); } } else { cout<<"\n\n\nINPUT CORRECT PASSWORD!!!\n\n"; getch(); getch(); getch(); getch(); getch(); getch(); exit(0); } } if(j==2) { custmenu: system("cls"); cout<<"================================================================="; cout<<"\n\n\t\t\t CUSTOMER MENU\n1. Purchase\n2. Display stock\n3. Exit:"; cout<<"\n\n\n==========================END OF MENU============================="; cout<<"\n\n Enter your Choice :\t"; cin>>i; if (i==1) { withdraw();getch();goto custmenu; } else if(i==2) { system("cls"); disp();getch();goto custmenu; } else { system("cls"); getch(); exit(0); } } if(j==3) { system("cls"); cout<<"\n\n\n\n\t\tPlease enter the password: "; for(int z=0;z<12;z++) { pass2[z]=getch(); system("cls"); cout<<"\n\n\n\n\t\t\t\tPlease enter the password : "; for(i=1;i<=(z+1);i++) { cout<<"*"; } } if(strcmp(pass2,"aaaaaaaaaaaa")==0) { empmenu: system("cls"); cout<<"==============="; cout<<"\n\n\t\t\tEMPLOYEE MENU\n1. Display stock\n2. Refill\n3. Exit"; cout<<"\n\n\n=======END OF MENU=="; cout<<"\n\n Enter your Choice :\t"; cin>>i; if(i==1) { system("cls"); disp();getch();goto empmenu; } else if(i==2) { refill();goto empmenu; } else { system("cls"); cout<<"\n\n\n\t\t\tThank You!!"; getch(); exit(0); } } else { cout<<"\n\nSorry!! Please Provide Valid Password..\n\n"; getch(); getch(); getch(); getch(); getch(); exit(0); } } getch(); } |
Download Source code of inventory Management system project in C++