Professional Documents
Culture Documents
Computer Project
Computer Project
S. Content Teacher’s
NO. Signature
1.
Acknowledgement
4. Program coding
6. Bibliography
ACKNOWLEDGEMENT
“There are times when silence speaks so much more loudly than
words of praise to only as good as belittle a person, whose words
do not express, but only put a veneer over true feelings, which are
of gratitude at this point of time.”
I would like to sincerely thank all the people who helped and motivated me
throughout the project.
I would like to pay my gratitude to Mrs. (PGT Computer Science,
who with her keen insights and valuable feedback helped me to compile this
project. Without her assistance and encouragement this project would have not
been possible.
Special thanks to my parents, who actually helped me in all ways and their
support, pushed me to move further and further in this project.
-xyz
INTRODUCTION
Objective:-
To develop a C++project to manage a
Patanjali Departmental Store using object
oriented programming and data file
handling.
1.)#include<fstream.h>
It declares several useful library functions for performing
"console input and output" from a program. fstream is the
result of a multiple inheritance with ifstream and ofstream,
which both inherit from iostream. Its functions:
cin – used for input
cout– used for output
read( ) – used to read blocks of binary data
write( ) – used to write blocks of binary data
seekg( ) – let you to manipulate get pointer in the file
tellg () – retuns the position of getpointer in a file
stream.
2.)#include<conio.h>
It’s a C header file that declares several useful library
functions for performing "console input and output" from a
program, used mostly by MS dos compiler to provide
input/output. Its functions:
getch() – reads a character directly from console
without buffer
4.)#include<stdio.h>
It defines one variable type, one macro, and various
functions for manipulating arrays of characters. Input and
output operations of strings can also be performed in C++.
Its functions:
gets( ) – get string from stream
puts( ) – write string from stream
5.)#include<string.h>
The library enables you to manipulate a string that end in
the character ‘\0’, the null character. Its functions:
strcmp(str1,str2) –returns an integer that is negative
is str1<str2,zero if str1==str2, positive if
. str1>str2
strcmpi(str1,str2) – behave like strcmp but ignores
case
strcpy(toS,fromS) –copies from fromS to toS
USER DEFINED
FUNCTIONS
//---------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------//
//************************* BY **************************//
//------------------------------------------------------------------------------------//
#include<conio.h> // ***************************
#include<fstream.h> // **************************
//********************************//
{ //********************************//
public:
{ return pno; }
// MEMBER
//
{ return dis;}
}; // End of CLASS
//Global declaration for stream object and class object
fstream fp;
product pr;
cout<<"\n\n";
textcolor(21);
cin>>pno;
cout<<"\n\n";
textcolor(43);
gets(name);
cout<<"\n";
textcolor(13);
cout<<"\n";
textcolor(4);
cin>>dis;
void product::displayP()
cout<<"\n";
textcolor(9);
cout<<"\n";
textcolor(21);
puts(name);
cout<<"\n";
textcolor(2);
cprintf("The Price of the Product : ");
cout<<price;
cout<<"\n";
textcolor(17);
cprintf("Discount : ");
cout<<"\n\n";
textcolor(41);
getch();
} //End of this function
void display_all()
clrscr();
cout<<"\n\n\n\t\t";
textcolor(7);
cout<<"\n\n";
cout<<"\n\n====================================\n";
getch();
int flag=0;
{ //Function to Display
clrscr();
flag=1;
if(flag==0)
cout<<"\n\n";
textcolor(3);
getch();
// *BY*
// *SUMIT*
int no,found=0;
clrscr();
cout<<"\n\n\t";
textcolor(7);
cout<<"\n\n\t";
textcolor(8);
cin>>no;
if(pr.retpno()==no)
cout<<"\n";
textcolor(29);
cout<<endl;
int pos=-1*sizeof(pr);
fp.seekp(pos,ios::cur);
fp.write((char*)&pr,sizeof(product));//Writing newRecord
cout<<"\n\n\t";
textcolor(13);
cprintf("Record Updated");
found=1;
if(found==0)
cout<<"\n\n";
textcolor(11);
getch();
}
void delete_product()
int no;
clrscr();
cout<<"\n\n\n\t";
textcolor(34);
cprintf("Delete Record");
cout<<"\n\n";
textcolor(5);
cprintf("Please Enter The product no. of The Product You Want To Delete : ");
cin>>no;
{
if(pr.retpno()!=no) //Checking for Product Number
fp2.close(); // CLOSING
cout<<"\n\n\t";
textcolor(17);
getch();
void menu()
if(!fp)
{ textcolor(99);
cprintf("ERROR!!! FILE COULD NOT BE OPEN");
cout<<"\n\n\n";
textcolor(81);
cout<<"\n\n\n";
textcolor(33);
getch();
exit(0);
cout<<"\n\n\t\t";
textcolor(44);
cprintf("Product MENU");
cout<<"\n\n";
cout<<"==================================================\n";
cout<<"P.NO.\t\tNAME\t\tPRICE\n";
cout<<"==================================================\n";
while(fp.read((char*)&pr,sizeof(product))) //Reading from the File
cout<<pr.retpno()<<"\t\t"<<pr.retname()<<"\t\t"<<pr.retprice()<<endl;
} //Returning Values
menu();
cout<<"\n============================";
cout<<"\n============================\n";
do{
cout<<"\n\n";
textcolor(42);
cin>>order_arr[c];
cout<<"\n";
textcolor(36);
cin>>quan[c];
c++;
cout<<"\n";
textcolor(49);
cin>>ch;
while(ch=='y' ||ch=='Y');
cout<<"\n\n";
textcolor(31);
getch();
clrscr();
cout<<"\n\n******************INVOICE********************\n";
for(int x=0;x<=c;x++)
while(!fp.eof())
if(pr.retpno()==order_arr[x])
cout<<"\n"<<order_arr[x]<<"\t"<<pr.retname()<<"\t"<<quan[x]<<"\t\t";
cout<<pr.retprice()<<"\t"<<amt<<"\t\t"<<damt;
cout<<"\n\n\t\t\t\t\tTOTAL ="<<total;
getch();
// ^^ B^Y^ ^^
{ // ^^ M^E^H^T^A^ ^^
void main()
char ch;
clrscr();
cout<<"\n\n\n\n";
textcolor(CYAN + BLINK);
cprintf("*********************************************************");
cout<<"\t";
textcolor(5);
cout<<"\t"; // SCREEN
textcolor(30); // OF MY
cprintf("STORE"); // PROJECT
cout<<"\t\t";
textcolor(25);
cprintf("BILLING");
cout<<"\t\t";
textcolor(35);
cprintf("MANAGEMENT");
cout<<"\t";
textcolor(45);
cprintf("SYSTEM");
cout<<"\n";
textcolor(CYAN + BLINK);
cprintf("*********************************************************");
cout<<"\n";
textcolor(29);
textcolor(11);
cout<<"\n\n\n\n";
textcolor(12);
cout<<"\n";
textcolor(13);
cout<<"\n";
getch();
do
clrscr();
cout<<"\n\n\n";
textcolor(249);
cprintf("***********");
cout<<"\n";
cprintf("*USER MENU*");
cout<<"\n";
cprintf("***********");
cout<<"\n\n";
textcolor(3);
cprintf("1* CUSTOMER");
cout<<"\t";
textcolor(22);
cprintf("2* SHOPKEEPER");
cout<<"\t";
textcolor(25);
cprintf("3* EXIT"); //*****************************
textcolor(2); //*****************************
ch=getche();
switch(ch)
getch();
break;
char ch2;
cout<<"\n\t\t\t\t";
textcolor(34);
cprintf("SHOPKEEPER'S MENU");
cout<<"\n\n\t";
textcolor(45);
cprintf("1* CREATE A NEW PRODUCT");
cout<<"\t\t";
textcolor(12);
cout<<"\n\n\t";
textcolor(20);
cprintf("3* INQUIRY");
cout<<"\t\t\t";
textcolor(15);
cout<<"\n\n\t";
textcolor(41);
cout<<"\t";
textcolor(11);
cout<<"\n\n\t";
textcolor(19);
cout<<"\n\n\n\n\n\n\n\t";
textcolor(50);
ch2=getche();
break;
case '3':
int num;
clrscr();
cout<<"\n\n\t";
textcolor(33);
cin>>num;
break;
getch();
} break;
case '3':exit(0);
default :cout<<"\a";
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BIBLIOGRAPHY
Mrs. RuchiChhabra
www.wikipedia.com
www.c++tutorialclassics.com
www.google.com