store management along with output

26
STORE MANAGEMENT ANAVADYA SHIBU XII-A REG NO.

Upload: anavadya-shibu

Post on 17-Jul-2015

267 views

Category:

Education


1 download

TRANSCRIPT

STORE

MANAGEMENT

ANAVADYA SHIBU

XII-A

REG NO.

ST. THOMAS CENTRAL SCHOOL

ST.THOMAS NAGAR

THIRUVANANTHAPURAM-695043

Certified Bonafide Record of Project work done in Computer

Science by................................................................................

Reg.no................................AISSCE March..............................

during the academic year...........................................................

1)............................ Internal Examiner

2)............................ External Examiner

DECLARATION

I hereby declare that the project entitled “Store Management”,

submitted to the Department of Computer Science,

St. Thomas Central School, Trivandrum is prepared by me.

All coding are the result of my personal efforts.

Anavadya Shibu

XII-A

ACKNOWLEDGEMENT

I would like to express a deep sense of thanks and gratitude to

my project guide Mrs. Nitha Aby Zachariah for guiding me

immensely through the project. She always evinced keen

interest in my work. Her constructive advice and strong

motivation have been responsible for the successful

completion of this project.

I also thank my parents for their motivation and support. I also

thank my classmates for their timely help and support for the

compilation of this project.

Last but not the least; I would like to thank all those who have

helped directly or indirectly towards the compilation of this

project.

CONTENTS

1. Introduction

2. Coding

3. Output

4. Conclusion

5. Bibliography

INTRODUCTION

Store management is “to receive materials, to protect them

while in storage from damage & unauthorized removal, to

issue the material in the right quantities, at the right time to

the right time to the right place and to provide these services

promptly and at least cost”.

A professionally managed Stores has a process and a space within,

to receive the incoming materials , keep them for as long as they are

not required for use (Custody) and then to move them out of stores for

use.

In a manufacturing firm this process forms a cycle to maintain and

run the activities of Stores.

The basic responsibilities of stores are to act as custodian and

controlling agent for parts, supplies, and materials, and to provide

service to customers of those goods.

Header files used in the project and their purpose:

1. #include<conio.h> - for clrscr() and getch() functions

2. #include<stdio.h> - for standard i/o operations

3. #include<process.h> - for exit() function

4. #include<fstreamh> - for data file handling

5. #include<stdlib.h> - for random() function

Escape sequence \a is used in the following code for in the C

programming; the bell character can be placed in a string or

character constant with \a . ('a' stands for "alert" or "audible".

Various functions used in the coding

1. CREATE PRODUCT – To create the list of products to be

placed

2. DISPLAY ALL PRODUCTS – To display the list of

products available

3. QUERY - Inquiry

4. MODIFY PRODUCT – To modify the details of a product

5. DELETE PRODUCT – To delete any product

6. VIEW PRODUCT MENU – Serves almost same function

of Display

The following code allow the customer to avail discount in

case of specific prices for this purpose random() function is

used.

CODING

//***************************************************************

******** // HEADER FILES USED IN THE PROGRAM

//***********************************************************************

#include<conio.h> #include<stdio.h> #include<process.h>

#include<fstream.h> #include<stdlib.h>

//***********************************************************************

// CLASSES USED IN PROJECT //***************************************************************

******** class product

{ int pno;

char name[30]; float price; public:

void create_product() {

cout<<"\nPlease Enter Product No. of the product : "; cin>>pno;

cout<<"\nPlease Enter Name of the product : "; gets(name);

cout<<"\nPlease Enter the price of the product : "; cin>>price;

} void show_product()

{ cout<<"\nProduct No. "<<pno;

cout<<"\nName of product : "; puts(name); cout<<"\nPrice of product : "<<price;

} int retpno(){return pno;}

float retprice(){return price;} char* retname(){return name;}

}; //***************************************************************

******** //GLOBAL DECLARATION FOR STREAM OBJECT,OBJECT

//***********************************************************************

fstream fp; product pr;

//***********************************************************************

// FUNCTION TO WRITE IN FILE //***************************************************************

******** void write_product()

{ fp.open("Store.dat",ios::app); pr.create_product();

fp.write((char*)&pr,sizeof(pr)); fp.close();

cout<<"\n\nThe product has been created. "; getch(); }

//***********************************************************************

// FUNCTION TO READ ALL RECORDS FROM FILE //***************************************************************

******** void display_all()

{ clrscr(); cout<<"\n\n\t\tDISPLAY ALL RECORD!!\n\n";

fp.open("Store.dat",ios::in); while(fp.read((char*)&pr,sizeof(pr)))

{ pr.show_product();

cout<<"\n\n======== ======== ======\n"; getch();

} fp.close();

} //***************************************************************

******** // FUNCTION TO READ SPECIFIC RECORD FROM FILE

//***********************************************************************

void display(int n) {

int flag=0; fp.open("Store.dat",ios::in);

while(fp.read((char*)&pr,sizeof(pr))) {

if(pr.retpno()==n) {

clrscr(); pr.show_product();

flag=1; }

fp.close(); if(flag==0) cout<<"\n\nRecord does not exist";

getch(); }

} //***************************************************************

******** // FUNCTION TO MODIFY RECORD OF FILE

//***********************************************************************

void modify_product() {int no;

fstream f1("Store.dat",ios::in|ios::out|ios::binary); cout<<"Please enter the product no you are searching for : "; cin>>no;

while(f1) {int m=f1.tellg();

if(pr.retpno()==no) {pr.create_product();

f1.seekp(m); f1.write((char*)&pr,sizeof(pr));

}} f1.close();

}

//***********************************************************************

//FUNCTION TO DELETE RECORD FILE

//***********************************************************************

void delete_product() {

int no; clrscr();

cout<<"\n\n\tDelete Record"; cout<<"\n\nPlese enter the Product no. of the P{roduct to be deleted : ";

cin>>no; fp.open("Store.dat",ios::in|ios::out);

fstream fp2; fp2.open("Temp.dat",ios::out);

fp.seekg(0,ios::beg); while(fp.read((char*)&pr,sizeof(pr)))

{ if(pr.retpno()!=no) {

fp2.write((char*)&pr,sizeof(pr)); }

fp2.close(); fp.close();

remove("Store.dat"); rename("Temp.dat","Store.dat");

cout<<"\n\n\tRecord Deleted.."; getch();

} //***************************************************************

******** // FUNCTION TO DISPLAY PRICES OF ALL PRODUCTS //***************************************************************

******** void menu()

{ clrscr();

fp.open("Store.dat",ios::in); if(!fp)

{ cout<<"ERROR!!!FILE COULD NOT BE OPEN\n\n\nGo To Admin Menu to

create File"; cout<<"\n\n\tProgram is closing........";

getch(); exit(0);

}

cout<<"\n\n\t\tPRODUCT MENU\n\n"; cout<<"===================================================

==================\n"; cout<<"P.NO.\t\tNAME\t\t\tPRICE\N";

cout<<"=====================================================================\N";

while(fp.read((char*)&pr,sizeof(pr))) cout<<pr.retpno()<<"\t\t"<<pr.retname()<<"\t\t"<<pr.retprice()<<endl;

cout<<"=====================================================================\n";

fp.close(); }

//***************************************************************

******** //FUNCTION TO PLACE ORDER AND GENERATING BILL FOR PRODUCTS

//***********************************************************************

void place_order() {

int order_arr[50],quan[50],c=0,ic=0; float amt,total=0;

char ch='Y'; menu();

cout<<"\n\n\n\tPLACE YOUR ORDER";

cout<<"\n\n\n"; do {

cout<<"\n\nEnter the product no. of the product : "; cin>>order_arr[c];

cout<<"Quantity in number : "; cin>>quan[c],ic+=quan[c];

c++; cout<<"Do you want to order another product?(Y/N)";

cin>>ch; }

while((ch=='y')||(ch=='Y')); cout<<"\nTHANK YOU FOR PLACING ORDER ";

getch(); clrscr();

cout<<"\n\n\n";

cout<<"\n\n*************************INVOICE**********************************";

cout<<"\nPr.no.\tPr.Name\t\tQuantity\tPrice\tAmount\n"; cout<<"*********************************************************

***********\n"; for(int x=0;x<=c;x++)

{ fp.open("Store.dat",ios::in);

fp.read((char*)&pr,sizeof(pr)); while(!fp.eof())

{ if(pr.retpno()==order_arr[x])

{ amt=pr.retprice()*quan[x];

cout<<"\n"<<order_arr[x]<<"\t"<<pr.retname()<<"\t"<<quan[x]<<"\t\t"<<pr.retprice()<<"/t"<<amt; total+=amt;

} fp.read((char*)&pr,sizeof(pr));

} fp.close();

} cout<<"\n********************************************************

************"; cout<<"\nItems count :-"<<ic<<"\t\t\t"<<"Bill amount:-"<<total;

cout<<”\n\t**THANK YOU AND VISIT AGAIN**”; getch();

disc_app(total); } //========================================================

== //***************************************************************

******** // INTRODUCTION FUNCTION

//***********************************************************************

void intro() {

clrscr(); gotoxy(30,15);

cout<<"\n=========================================================================";

cout<<"\n|Welcome to purchase corner of store |";

cout<<"\n|MADE BY : Anavadya & Megha |"; cout<<"\n|SCHOOL : St. Thomas Central School |";

cout<<"\n=========================================================================";

getch(); }

//***************************************************************

******** // ADMINISTRATOR MENU FUNCTION

//***********************************************************************

void admin_menu() {

clrscr(); char ch2; cout<<"\n########################################################

#######"; cout<<"\n\n\tADMINISTRATOR MENU";

cout<<"\n\n\t1.CREATE PRODUCT"; cout<<"\n\n\t2.DISPLAY ALL PRODUCTS";

cout<<"\n\n\t3.QUERY"; cout<<"\n\n\t4.MODIFY PRODUCT";

cout<<"\n\n\t5.DELETE PRODUCT"; cout<<"\n\n\t6.VIEW PRODUCT MENU";

cout<<"\n\n\t7.BACK TO MAIN MENU"; cout<<"\n\n\tPlease Enter your Choice(1-7)";

cout<<"\n################################################################"; cin>>ch2;

switch(ch2) {

case 1:clrscr(); write_product();break;

case 2:display_all();break; case 3:place_order();

break; case 4:modify_product();break;

case 5:delete_product();break; case 6:menu();getch();break;

case 7:break; default:cout<<"/a";

admin_menu();

} }

//***********************************************************************

// THE MAIN FUNCTION OF PROGRAM //***************************************************************

******** void main()

{ char ch='y',ch1='y',ans='y';

int n,i; intro();

ofstream fp("Store.dat",ios::binary|ios::app); while(ch=='y')

{ pr.create_product(); fp.write((char*)&pr,sizeof(pr));

cout<<"\nWould you like to continue adding files ??(y/n) "; cin>>ch; }

fp.close(); while(ch1=='y')

{ cout<<"\n\n\tMAIN MENU";

cout<<"\n\n\t1.CUSTOMER"; cout<<"\n\n\t2.ADMINISTRATOR";

cout<<"\n\n\t3.EXIT"; cout<<"\nPlease select your option(1-3)";

cin>>ans; switch (ans) {

case 1:place_order();break; case 2:admin_menu();break;

case 3:exit(0); }

cout<<"Do you want to continue?Press y or n."; cin>>ch1;

getch(); }

}

OUTPUT

1.INTRODUCTION ==========================================

|Welcome to purchase corner of Store |

|NAME: Anavadya & Megha |

|SCHOOL: St. Thomas Central School |

==========================================

2.CREATING PRODUCTS Please Enter Product No. of the product :101 Please Enter Name of the product : Kissan Mixed Fruit Jam

Please Enter price of the product : 45

Please Enter Product No. of the product :102 Please Enter Name of the product : Heinz Tomato Ketchup

Please Enter price of the product : 60

Please Enter Product No. of the product :103 Please Enter Name of the product : Knorr Tomato Soup

Please Enter price of the product : 40

Please Enter Product No. of the product :104

Please Enter Name of the product : Lays Magic Masala

Please Enter price of the product : 15

Please Enter Product No. of the product :105 Please Enter Name of the product : Tropicana Litchi and Apple Delight

Please Enter price of the product : 50

Please Enter Product No. of the product :106 Please Enter Name of the product : Oreo Chocolate cookie

Please Enter price of the product : 40

3.MAIN MENU

MAIN MENU

1.CUSTOMER

2.ADMINISTRATION

3.EXIT

Please select your option: 1

4. CUSTOMER (Displaying products and Placing order) DETAILS OF PRODUCT

Product No.101 Name of product : Kissan Mixed Fruit Jam

Price of the product : 45

Product No. of the product :102 Name of product : Heinz Tomato Ketchup

Price of the product : 60

Product No.103 Name of product : Knorr Tomato Soup

Price of the product : 40

Product No.104 Name of product : Lays Magic Masala

Price of the product : 15

Product No.105 Name of product : Tropicana Litchi and Apple Delight

Price of the product : 50

Product No. of the product :106 Name of product : Oreo Chocolate cookie

Price of the product : 40

PLACE YOUR ORDER

Enter the product no. of the product:101

Quantity in number:3

Do you want to order another product?(Y/N)Y

Enter the product no. of the product:106

Quantity in number:2

Do you want to order another product?(Y/N)Y

Enter the product no. of the product:103

Quantity in number:2

Do you want to order another product?(Y/N)N

THANK YOU FOR PLACING ORDER

*************************INVOICE******************************* Pr.no Pr.Name Quantity Price Amount

101 Kissan Mixed Fruit Jam 3 45 135

106 Oreo Chocolate Cookie 2 40 120

103 Knorr Tomato Soup 2 40 120

Items count :- 7 Bill amount:- 375

**THANK YOU AND VISIT AGAIN**

ADMINISTRATION MAIN MENU

1.CUSTOMER

2.ADMINISTRATION

3.EXIT

Please select your option: 2

################################################################

ADMINISTRATOR MENU

1.CREATE PRODUCT

2.DISPLAY ALL PRODUCTS

3.QUERY

4.MODIFY PRODUCT

5.DELETE PRODUCT

6.VIEW PRODUCT MENU

7.BACK TO MAIN MENU

Please Enter your Choice(1-7)1

################################################################ 1

Please Enter Product No. of the product : 107

Please Enter Name of the product : Amul Frostbite

Please Enter the price of the product : 30

The product has been created.

Do you want to continue?Press y or n.y

MAIN MENU

1.CUSTOMER

2.ADMINISTRATION

3.EXIT

Please select your option: 2

################################################################

ADMINISTRATOR MENU

1.CREATE PRODUCT

2.DISPLAY ALL PRODUCTS

3.QUERY

4.MODIFY PRODUCT

5.DELETE PRODUCT

6.VIEW PRODUCT MENU

7.BACK TO MAIN MENU

Please Enter your Choice(1-7)2

################################################################

PRODUCT MENU

P.NO. NAME PRICE

==============================================================

101 Kissan Mixed Fruit Jam 45

102 Heinz Tomato Ketchup 60

103 Knorr Tomato Soup 40

104 Lays Magic Masala 15

105 Tropicana Litchi and Apple Delight 50

106 Oreo Chocolate cookie 40

107 Amul Frostbite 30

=========================================================

Do you want to continue?Press y or n.y

MAIN MENU

1.CUSTOMER

2.ADMINISTRATION

3.EXIT

Please select your option: 2

################################################################

ADMINISTRATOR MENU

1.CREATE PRODUCT

2.DISPLAY ALL PRODUCTS

3.QUERY

4.MODIFY PRODUCT

5.DELETE PRODUCT

6.VIEW PRODUCT MENU

7.BACK TO MAIN MENU

Please Enter your Choice(1-7)3

################################################################

Please enter the product no you are searching for : 105

Product No.105 Name of product : Tropicana Litchi and Apple Delight

Price of the product : 50

Do you want to continue?Press y or n.y

MAIN MENU

1.CUSTOMER

2.ADMINISTRATION

3.EXIT

Please select your option: 2

################################################################

ADMINISTRATOR MENU

1.CREATE PRODUCT

2.DISPLAY ALL PRODUCTS

3.QUERY

4.MODIFY PRODUCT

5.DELETE PRODUCT

6.VIEW PRODUCT MENU

7.BACK TO MAIN MENU

Please Enter your Choice(1-7)4

################################################################

Please enter the product no you are searching for : 105

Product No.105 Name of product : Tropicana Apple Delight

Price of the product : 50

Do you want to continue?Press y or n.y

MAIN MENU

1.CUSTOMER

2.ADMINISTRATION

3.EXIT

Please select your option: 2

################################################################

ADMINISTRATOR MENU

1.CREATE PRODUCT

2.DISPLAY ALL PRODUCTS

3.QUERY

4.MODIFY PRODUCT

5.DELETE PRODUCT

6.VIEW PRODUCT MENU

7.BACK TO MAIN MENU

Please Enter your Choice(1-7)5

################################################################

Delete Record

Please enter the Product no. of the Product to be deleted :

102

Product Deleted

Do you want to continue?Press y or n.y

MAIN MENU

1.CUSTOMER

2.ADMINISTRATION

3.EXIT

Please select your option: 2

################################################################

ADMINISTRATOR MENU

1.CREATE PRODUCT

2.DISPLAY ALL PRODUCTS

3.QUERY

4.MODIFY PRODUCT

5.DELETE PRODUCT

6.VIEW PRODUCT MENU

7.BACK TO MAIN MENU

Please Enter your Choice(1-7)6

################################################################

PRODUCT MENU

P.NO. NAME PRICE

==============================================================

101 Kissan Mixed Fruit Jam 45

103 Knorr Tomato Soup 40

104 Lays Magic Masala 15

105 Tropicana Apple Delight 50

106 Oreo Chocolate cookie 40

107 Amul Frostbite 30

=========================================================

Do you want to continue?Press y or n.y

MAIN MENU

1.CUSTOMER

2.ADMINISTRATION

3.EXIT

Please select your option: 2

################################################################

ADMINISTRATOR MENU

1.CREATE PRODUCT

2.DISPLAY ALL PRODUCTS

3.QUERY

4.MODIFY PRODUCT

5.DELETE PRODUCT

6.VIEW PRODUCT MENU

7.BACK TO MAIN MENU

Please Enter your Choice(1-7)7

################################################################

MAIN MENU

1.CUSTOMER

2.ADMINISTRATION

3.EXIT

Please select your option: 3

CONCLUSION

The above coding helps a store manager to manage the store

efficiently with the proper use of the above functions .

BIBLIOGRAPHY

Computer science with C++ - Sumita Arora

Turbo C++ Help

Codeblocks 10.05

www.cbsematerials.webnode.com

www.slideshare.net

www.wikipedia.org

www.ask.com

www.iCbse.com