Computer Science
Computer Science
PROJECT FILE
ON
BOOK-SHOP
. . . . . .
Commented [1]:
PROJECT PREPARED BY:
XII
Roll no.
Session: 2017-2018
TABLE OF CONTENTS
1. Acknowledgement
3. Coding
4. Limitations
5. Requirements
6. Bibliography
Acknowledgement
I thank my Computer Science teacher Miss. Shobha ma'am for guidance and
support. I also thank my Principal Mr. Sunil sir. I would also like to thank my parents and
my sister for encouraging me during the course of this project. Finally I would like to
thank CBSE for giving me this opportunity to undertake this project.
Certificate
This is to certify that Rohit Kumar mahto of class twelve,R.T.C high school buti
Ranchi has successfully completed his project in computer practicals for the AISSCE as
prescribed by CBSE in the year 2017-2018
Date :
Registration No. :
Examiner Examiner
__________________ __________________
#include<fstream.h>
#include<conio.h>
#include<string.h>
#include<process.h>
#include<stdio.h>
#include<ctype.h>
class subject
public:
char s[5][40],sub[5][5][40];
subject()
strcpy(sub[0][0],"Physics NCERT-I");
strcpy(sub[0][1],"Physics NCERT-II");
strcpy(sub[0][2],"Pradeep Physics");
strcpy(sub[0][3],"H.C.Verma\t");
strcpy(sub[0][4],"Together With");
strcpy(sub[1][0],"Chemistry NCERT-I");
strcpy(sub[1][1],"Chemistry NCERT-II");
strcpy(sub[1][2],"Pradeep Chemistry");
strcpy(sub[1][3],"Together With");
strcpy(sub[1][4],"P.Bahaadur\t");
strcpy(sub[2][0],"Maths NCERT-I");
strcpy(sub[2][1],"Maths NCERT-II");
strcpy(sub[2][2],"Maths ND-I\t");
strcpy(sub[2][3],"Maths ND-II");
strcpy(sub[2][4],"R.D.Sharma\t");
strcpy(sub[3][0],"Flemingo Textbook");
strcpy(sub[3][1],"Vistas Textbook");
strcpy(sub[3][2],"Flemingo ND");
strcpy(sub[3][3],"Vistas ND\t");
strcpy(sub[3][4],"Golden Guide");
strcpy(sub[4][0],"Sumita Arora");
strcpy(sub[4][1],"Together With");
strcpy(sub[4][2],"Evergreen C++");
strcpy(sub[4][3],"RohitQuestionBank");
strcpy(sub[4][4],"Osborne\t");
strcpy(s[0],"Physics\t");
strcpy(s[1],"Chemistry\t");
strcpy(s[2],"Maths\t");
strcpy(s[3],"English\t");
strcpy(s[4],"Computer Science");
};
void show();
void show2();
class userlist
public:
int no;
char users[100][50];
};
class user
public:
int sbj[5][7],totp,totr;
char password[20];
void showpb()
};
void chkusrlst();
void chkbooklst();
void showuserlist();
int crtusr();
int showbooks();
int openacc();
int main()
textbackground(3);
textcolor(0);
chkusrlst();
chkbooklst();
mpage:
clrscr();
char ch;
ch=getch();
switch(ch)
{ goto mpage;
break;
goto mpage;
goto mpage;
goto mpage;
goto mpage;
getch();
return 0;
int crtusr()
{
clrscr();
char name[50],reply;
ifstream fi;
fi.open("USERLIST");fi.read((char *) &list,sizeof(list));fi.close();
if(list.no==99)
page2:
cin.getline(name,49);uppercase(name);
if(name[0]=='\0'||name[0]==' ')
clrscr();
for(int i=0;name[i]!='\0';i++)
if(name[i]=='\\'||name[i]=='/'||name[i]==':'||name[i]=='*'||name[i]=='?'||name[i]=='\"'||nam
e[i]=='<'||name[i]=='>'||name[i]=='|')
{ clrscr();
cout<<"\n Please enter a valid name:";goto page2;
fi.open(name);
if(fi.good())
clrscr();
fi.close();
page: clrscr();
if(reply=='Y'||reply=='y')
{ clrscr();
cin.getline(u.password,19);
else if(reply=='N'||reply=='n')
{ strcpy(u.password,"########");
setdefault(u);
ofstream fo(name);
fo.write((char *) &u,sizeof(u));fo.close();
strcpy(list.users[list.no],name);list.no++;
fo.open("USERLIST");fo.write((char *) &list,sizeof(list));fo.close();
clrscr();cout<<"\n\n\tCongratulations! ";
show2();getch();
return 0;
int i,j;
for(i=0;i<5;i++)
for(j=0;j<7;j++)
usr.sbj[i][j]=0;
usr.totp=0;usr.totr=0;
void chkusrlst()
ifstream usrlst;
usrlst.open("userlist");
if(!usrlst.good())
ofstream fo("userlist");
userlist list;
list.no=0;
fo.write((char *) &list,sizeof(list));
fo.close();
usrlst.close();
void chkbooklst()
booklst.open("booklist");
if(!booklst.good())
ofstream fo("booklist");
user bklst;
for(i=0;i<5;i++)
for(j=0;j<5;j++)
bklst.sbj[i][j]=1000;
}
}
for(i=0;i<5;i++)
bklst.sbj[i][5]=0;bklst.sbj[i][6]=0;
bklst.totp=0;bklst.totr=0;
fo.write((char *)&bklst,sizeof(bklst));
fo.close();
booklst.close();
int showbooks()
page1: clrscr();
ifstream fi("Booklist");
fi.read((char *) &guest,sizeof(guest));
fi.close();cout<<"\n\n\n\n\n\n\n";
for(x=0;x<5;x++)
show();ch=getch();
for(i='1',x=0;i<='5';i++,x++)
page2: clrscr();
if(ch==i)
cout<<"\n\n\n\t\t"<<sb.s[x]<<"\n\n\n\n";
for(j=0;j<5;j++)
cout<<guest.sbj[x][j]<<" remaining\n";
for(k='1',y=0;k<='5';k++,y++)
if(ch1==k)
page3: clrscr();
cout<<"\n\t\t\t\t"<<sb.sub[x][y];
guest.showpb();show();ch2=getch();
if(ch2=='P'||ch2=='p')
if(guest.sbj[x][y]>0)
{ guest.totp++;guest.sbj[x][5]++;guest.sbj[x][y]--;
notification(guest);
}
else
clrscr();
show2();getch();goto page2;
break;
{
clrscr();
ofstream f("BOOKLIST");
f.write((char *) &u,sizeof(u));
f.close();
cout<<"Next time you must create\n\tan account so that you can ";
getch();
exit(0);
void show()
void show2()
clrscr();
cout<<"\n\n\n\n Subject\t\tPurchased\tReturned\n\n\n";
for(i=0;i<5;i++)
cout<<"\t\t"<<u.sbj[i][6]<<"\n";
cout<<" 6. "<<"Total\t\t"<<u.totp<<"\t\t"<<u.totr;show2();getch();
int openacc()
page1:clrscr();
uppercase(name);ifstream fi(name);
if(!fi.good())
{ pagename:
reply=getch();
}
fi.read((char *) &u,sizeof(u));fi.close();
fi.open("USERLIST");fi.read((char *) &list,sizeof(list));fi.close();
int flag=0;
for(int s=0;s<list.no;s++)
if(!strcmp(name,list.users[s])){ flag=1;break;}
if(flag==0)
{ strcpy(list.users[list.no],name);list.no++;
fo.open("USERLIST");
fo.write((char *) &list,sizeof(list));fo.close();
cin.getline(passw,19);
if(strcmp(u.password,passw))
{ pagepass:
reply=getch();
page3: clrscr();fi.open("BOOKLIST");
fi.read((char *) &bklst,sizeof(bklst));fi.close();
cout<<"\n\n\n\tWelcome "<<name;
if(reply=='1')
page31: clrscr();
cout<<"\n\n\n\n\n\n\n";
for(x=0;x<5;x++)
show();ch=getch();
for(i='1',x=0;i<='5';i++,x++)
page32: clrscr();
if(ch==i)
cout<<"\n\n\n\t\t"<<sb.s[x]<<"\n\n\n\n";
for(j=0;j<5;j++)
{
cout<<bklst.sbj[x][j]<<" remaining\n";
for(k='1',y=0;k<='5';k++,y++)
if(ch1==k)
page33: clrscr();
cout<<"\n\t\t\t\t"<<sb.sub[x][y];
if(ch2=='P'||ch2=='p')
if(bklst.sbj[x][y]>0)
u.totp++;bklst.totp++;u.sbj[x][5]++;bklst.sbj[x][5]++;
u.sbj[x][y]++;bklst.sbj[x][y]--;fo.open("BOOKLIST");
fo.write((char *) &bklst,sizeof(bklst));fo.close();
fo.open(name);fo.write((char *) &u,sizeof(u));fo.close();
else
{
clrscr();
show2();getch();
goto page32;
else if(ch2=='r'||ch2=='R')
if(u.sbj[x][y]>0)
u.totr++;bklst.totr++;u.sbj[x][6]++;bklst.sbj[x][6]++;
u.sbj[x][y]--;bklst.sbj[x][y]++;fo.open("BOOKLIST");
fo.write((char *) &bklst,sizeof(bklst));fo.close();
fo.open(name);fo.write((char *) &u,sizeof(u));fo.close();
else
clrscr();
show2();getch();
goto page32;
else if(reply=='2')
clrscr();
int i,j;
for(i=0;i<5;i++)
{ subject sb;
cout<<"\n "<<sb.s[i]<<"\n";
for(j=0;j<5;j++)
{
cout<<" "<<j+1<<". "<<sb.sub[i][j]<<"\t"<<u.sbj[i][j];
cout<<" remaining\n";
show2();getch();goto page3;
else if(reply=='3')
{ pur_ret(name);
goto page3;
else if(reply=='4')
cin.getline(passw,19);strcpy(u.password,passw);clrscr();
fo.open(name);fo.write((char *) &u,sizeof(u));fo.close();
goto page3;
else if(reply=='5')
if(reply=='Y'||reply=='y')
{ strcpy(u.password,"########");fo.open(name);
fo.write((char *) &u,sizeof(u));fo.close();clrscr();
else if(reply=='6')
{ page36: clrscr();
if(reply=='Y'||reply=='y')
{ clrscr();remove(name);
namecutter(name);
return 0;
else{goto page36;}
else if(reply=='b'||reply=='B')
{ page3b: clrscr();
reply=getch();
for(int i=0;a[i]!='\0';i++)
a[i]=toupper(a[i]);
void showuserlist()
fi.read((char *) &list,sizeof(list));fi.close();
for(i=0;i<list.no;i++)
show2();getch();
if(strcmp(u.users[i],name)==0)
strcpy(temp,u.users[i]);
strcpy(u.users[i],u.users[i+1]);
strcpy(u.users[i+1],temp);
u.no--;ofstream fo("USERLIST");
fo.write((char *) &u,sizeof(u));fo.close();
Requirements.
Hardware Required
2.Compact Drive
3.Processor : Pentium III
4.Ram : 64 MB
5.Harddisk : 20 Gb.
software Required